/SparkleLib/SparkleChangeSet.cs

http://github.com/hbons/SparkleShare · C# · 77 lines · 43 code · 19 blank · 15 comment · 2 complexity · f726bae18cdcc83078f4d84b3821b49b MD5 · raw file

  1. // SparkleShare, a collaboration and sharing tool.
  2. // Copyright (C) 2010 Hylke Bons <hylkebons@gmail.com>
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. using System;
  17. using System.IO;
  18. using System.Collections.Generic;
  19. namespace SparkleLib {
  20. public enum SparkleChangeType {
  21. Added,
  22. Edited,
  23. Deleted,
  24. Moved
  25. }
  26. public class SparkleChangeSet {
  27. public SparkleUser User = new SparkleUser ("Unknown", "Unknown");
  28. public SparkleFolder Folder;
  29. public Uri RemoteUrl;
  30. public string Revision;
  31. public DateTime Timestamp;
  32. public DateTime FirstTimestamp;
  33. public List<SparkleChange> Changes = new List<SparkleChange> ();
  34. }
  35. public class SparkleChange {
  36. public SparkleChangeType Type;
  37. public string Path;
  38. public string MovedToPath;
  39. public DateTime Timestamp;
  40. }
  41. public class SparkleFolder {
  42. public string Name;
  43. public Uri RemoteAddress;
  44. public string FullPath {
  45. get {
  46. string custom_path = SparkleConfig.DefaultConfig.GetFolderOptionalAttribute (Name, "path");
  47. if (custom_path != null)
  48. return Path.Combine (custom_path, Name);
  49. else
  50. return Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, Name);
  51. }
  52. }
  53. public SparkleFolder (string name)
  54. {
  55. Name = name;
  56. }
  57. }
  58. }