Пример #1
0
 public object Clone()
 {
     var cl = new CommonFolder();
     cl.Name = this.Name;
     cl.Path = this.Path;
     return cl;
 }
Пример #2
0
        internal void RemoveCommonFolder(CommonFolder folder)
        {
            if (folder == null) return;

            var fldr = settings.CommonFolders.FirstOrDefault(f => f.Path == folder.Path);
            if (fldr != null)
            {
                int idx = settings.CommonFolders.IndexOf(fldr);
                if (idx != -1)
                {
                    settings.CommonFolders.RemoveAt(idx);
                    RaisePropertyChanged("Settings");
                    SaveSettings();
                }
            }
        }
Пример #3
0
 internal void AddCommonFolder(string path)
 {
     string[] parts = path.Split(Path.DirectorySeparatorChar);
     string leaf = parts[parts.Length - 1];
     var cf = new CommonFolder() { Name = leaf, Path = path };
     settings.CommonFolders.Add(cf);
     RaisePropertyChanged("Settings");
     SaveSettings();
 }