예제 #1
0
 public FolderPicker()
 {
     folderPathModel = new FolderPathModel();
 }
예제 #2
0
        private static FolderPathModel FolderPathBuilder(string id, string typeNameKey, string fmtype, string sfmType)
        {
            var fpm = new FolderPathModel();

            if (fmtype == "small")
            {
                if (!string.IsNullOrEmpty(sfmType))
                {
                    //var sfmType = String.Empty;

                    /* * 1. Архитектура решения = sfmType1
                     * * 2. Схема реализации = sfmType2
                     * * 3. КП подрядчиков = sfmType3
                     * * 4. Паспорт сделки = sfmType4
                     * */
                    fpm.AddRootPath(String.Format(@"C:\Documents\SmallProjects\{0}\{1}\{2}", typeNameKey, id, sfmType));
                }
                else
                {
                    fpm.AddRootPath(String.Format(@"C:\Documents\SmallProjects\{0}\{1}\Home", typeNameKey, id));
                }
            }
            else if (fmtype == "big")
            {
                var rootPath = String.Format(@"C:\Documents\Projects\{0}\{1}\Home", typeNameKey, id);
                fpm.AddRootPath(rootPath);
                if (typeNameKey == "new_t_project")// добавляем еще папки по умолчанию
                {
                    FolderSection folderSection = ConfigurationManager.GetSection("FolderSection") as FolderSection;
                    if (folderSection == null)
                    {
                        throw new Exception("Exception text");
                    }
                    else
                    {
                        for (int i = 0; i < folderSection.Folders.Count; i++)
                        {
                            var folder     = folderSection.Folders[i];
                            var folderName = folder.FolderName;
                            var subFolders = new List <FolderModel>();
                            for (int j = 0; j < folder.SubFolders.Count; j++)
                            {
                                var subFolder     = folder.SubFolders[j];
                                var subfolderName = subFolder.SubFolderName;
                                subFolders.Add(new FolderModel(subfolderName, new List <FolderModel>()));
                            }
                            var folderModel = new FolderModel(folderName, subFolders);
                            fpm.AddFolderModel(folderModel);
                        }
                    }

                    #region Old
                    //var folderLoopCount = int.Parse(System.Configuration.ConfigurationManager.AppSettings["folderLoopCount"]);
                    //for (int i = 0; i < folderLoopCount; i++)
                    //{
                    //    var keyIndex = "folder" + i;
                    //    var subPath = "";
                    //    try
                    //    {
                    //        subPath = System.Configuration.ConfigurationManager.AppSettings[keyIndex];
                    //    }
                    //    catch (Exception)
                    //    {
                    //        subPath = "Папка с таким именим не заведена в web.config";
                    //        throw;
                    //    }
                    //    folderPaths.Add(String.Format(@"C:\Documents\Projects\{0}\{1}\Home\{2}", typeNameKey, id, subPath));
                    //}
                    #endregion
                }
                else
                {
                }
            }
            return(fpm);
        }
예제 #3
0
 public MainWindowViewModel()
 {
     this.folderPathModel   = new FolderPathModel();
     this.snapshotListModel = new SnapshotsListModel();
 }