public void AddFolder(string folderName) { string path = Location + "/" + folderName; Directory.CreateDirectory(path); FoldersCollection.Add(new FolderItem(path, FoldersCollection, ContainingProject, null)); }
/// <summary> /// Выодит все папки как массив <see cref="FoldersCollection"/> /// </summary> /// <returns><see cref="FoldersCollection"/></returns> public FoldersCollection[] SelectAllFolders() { // считаем количество папок //int rowCount = MysqlNumRows("tb_folders"); int rowCount = classMysql.getNumRows("SELECT id FROM tb_folders"); // Создаем массив коллекций нужного размера FoldersCollection[] foldersCollection = new FoldersCollection[rowCount]; // Получаем все папки из базы string query = "SELECT * FROM tb_folders"; MySqlCommand command = new MySqlCommand(query, dbLink); dbLink.Open(); MySqlDataReader mysqlDataReaderFolders = command.ExecuteReader(); rowCount = 0; // добавляем папки из базы в массив коллекций while (mysqlDataReaderFolders.Read()) { foldersCollection[rowCount].id = Convert.ToInt32(mysqlDataReaderFolders.GetString("id")); foldersCollection[rowCount].name = mysqlDataReaderFolders.GetString("name"); rowCount++; } dbLink.Close(); rowCount = 0; foreach (FoldersCollection folder in foldersCollection) { foldersCollection[rowCount].parentId = classRelation.GetIdParentByIdFolder(folder.id); rowCount++; } return(foldersCollection); }
public Database() { mState = DatabaseStateEnum.Initializing; mSqlConnection = new SqlConnection(); mSqlCommand = new SqlCommand { Connection = mSqlConnection }; mFolders = new FoldersCollection(this); Dome.Databases.Add(this); }
private void Initialize(ManagedInstanceDirective directive = null) { Directives = directive ?? new ManagedInstanceDirective(); Log.Logger.Debug("Instance initialized with {@directive}", Directives); Information = new Information(this); Statistics = new Statistic(this); Synchronization = new Synchronization(this); Announcers = new AnnouncerCollection(); Folders = new FoldersCollection(); Errors = new ErrorCollection(); PossibleEndpoints = new RestEndpointCollection(); Id = Guid.NewGuid(); ConfigureThreads(); ConfigureStateMachine(); }
public Folder() : base("Folders") { mSubFolders = new FoldersCollection(this); mFields = new FieldsCollection(this); mDocuments = new DocumentsCollection(this); }