+ private string _kind;
+ public string Kind
+ {
+ get { return _kind; }
+ set
+ {
+ _kind = value;
+ NotifyOfPropertyChange(() => Kind);
+ }
+ }
+
+ private string _size;
+ public string Size
+ {
+ get { return _size; }
+ set
+ {
+ _size = value;
+ NotifyOfPropertyChange(() => Size);
+ }
+ }
+
+ private string _shortSize;
+ public string ShortSize
+ {
+ get { return _shortSize; }
+ set
+ {
+ _shortSize = value;
+ NotifyOfPropertyChange(() => ShortSize);
+ }
+ }
+
+ private string _where;
+ public string Where
+ {
+ get { return _where; }
+ set
+ {
+ _where = value;
+ NotifyOfPropertyChange(() => Where);
+ }
+ }
+
+ private DateTime _modified;
+ public DateTime Modified
+ {
+ get { return _modified; }
+ set
+ {
+ _modified = value;
+ NotifyOfPropertyChange(() => Modified);
+ }
+ }
+
+ private string _modifiedBy;
+ public string ModifiedBy
+ {
+ get { return _modifiedBy; }
+ set
+ {
+ _modifiedBy = value;
+ NotifyOfPropertyChange(() => ModifiedBy);
+ }
+ }
+
+ private long _version;
+ public long Version
+ {
+ get { return _version; }
+ set
+ {
+ _version = value;
+ NotifyOfPropertyChange(() => Version);
+ }
+ }
+
+ private string _localFileName;
+ protected string LocalFileName
+ {
+ get { return _localFileName; }
+ set
+ {
+ _localFileName = value;
+ NotifyOfPropertyChange(() => LocalFileName);
+ }
+ }
+
+ private BitmapSource _fileIcon;
+ public BitmapSource FileIcon
+ {
+ get { return _fileIcon; }
+ set
+ {
+ _fileIcon = value;
+ NotifyOfPropertyChange(() => FileIcon);
+ }
+ }
+
+ private string _publicUrl;
+ public string PublicUrl
+ {
+ get { return _publicUrl; }
+ set
+ {
+ _publicUrl = value;
+ NotifyOfPropertyChange(() => PublicUrl);
+ }
+ }
+
+ private string _fileName;
+ public string FileName
+ {
+ get { return _fileName; }
+ set
+ {
+ _fileName = value;
+ NotifyOfPropertyChange(() => FileName);
+ }
+ }
+
+ private string _container;
+ public string Container
+ {
+ get { return _container; }
+ set
+ {
+ _container = value;
+ NotifyOfPropertyChange(() => Container);
+ }
+ }
+
+ private string _synchStatus;
+ public string SynchStatus
+ {
+ get { return _synchStatus; }
+ set
+ {
+ _synchStatus = value;
+ NotifyOfPropertyChange(()=>SynchStatus);
+ }
+ }
+
+ private Permission _currentPermission;
+ public Permission CurrentPermission
+ {
+ get { return _currentPermission; }
+ set
+ {
+ _currentPermission = (value==null)?new Permission() : value.Clone();
+ _currentPermission.PropertyChanged += (o, e) => NotifyOfPropertyChange(() => CanAddPermission);
+
+ NotifyOfPropertyChange(()=>CurrentPermission);
+ NotifyOfPropertyChange(() => CanAddPermission);
+ }
+ }
+
+ public bool CanAddPermission
+ {
+ get { return !String.IsNullOrWhiteSpace(CurrentPermission.UserName); }
+ }
+
+ public void AddPermission()
+ {
+ var existingPermission = Permissions.FirstOrDefault(perm => perm.UserName == CurrentPermission.UserName);
+ if (existingPermission==null)
+ Permissions.Add(CurrentPermission.Clone());
+ else
+ {
+ existingPermission.Read = CurrentPermission.Read;
+ }
+ }
+
+ public bool CanAddTag
+ {
+ get { return !String.IsNullOrWhiteSpace(CurrentTag.Name); }
+ }
+
+ public void AddTag()
+ {
+ var existingTag = Tags.FirstOrDefault(tag => tag.Name == CurrentTag.Name);
+ if (existingTag == null)
+ Tags.Add(CurrentTag.Clone());
+ else
+ {
+ existingTag.Value = CurrentTag.Value;
+ }
+ }