private void EditMetaFileProperties(TreeNode metaFileNode) { if (metaFileNode.Text == "<пусто>") { return; } string currentMetaFilePath = GetNodePath(metaFileNode); if (currentMetaFilePath == "/") { MessageBox.Show(this, "Невозможно изменить свойства корневого каталога!", "Невозможно изменить свойства", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (currentMetaFilePath.StartsWith(DehaxOS.SYSTEM_DIRECTORY_PATH)) { MessageBox.Show(this, "Невозможно изменить свойства файлов системы!", "Невозможно изменить свойства", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } PropertiesForm propertiesForm = new PropertiesForm(); propertiesForm.Attributes = _dehaxOS.GetAttributes(currentMetaFilePath); propertiesForm.AccessRights = _dehaxOS.GetAccessRights(currentMetaFilePath); if (propertiesForm.ShowDialog(this) == DialogResult.OK) { try { _dehaxOS.SetAttributes(currentMetaFilePath, propertiesForm.Attributes); _dehaxOS.SetAccessRights(currentMetaFilePath, propertiesForm.AccessRights); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } }
private void EditMetaFileProperties(TreeNode metaFileNode) { if (metaFileNode.Text == "<пусто>") { return; } string currentMetaFilePath = GetNodePath(metaFileNode); if (currentMetaFilePath == "/") { MessageBox.Show(this, "Невозможно изменить свойства корневого каталога!", "Невозможно изменить свойства", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (currentMetaFilePath.StartsWith(DehaxOS.SYSTEM_DIRECTORY_PATH)) { MessageBox.Show(this, "Невозможно изменить свойства файлов системы!", "Невозможно изменить свойства", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } PropertiesForm propertiesForm = new PropertiesForm(); propertiesForm.Attributes = _dehaxOS.GetAttributes(currentMetaFilePath); propertiesForm.AccessRights = _dehaxOS.GetAccessRights(currentMetaFilePath); if (propertiesForm.ShowDialog(this) == DialogResult.OK) { try { _dehaxOS.SetAttributes(currentMetaFilePath, propertiesForm.Attributes); _dehaxOS.SetAccessRights(currentMetaFilePath, propertiesForm.AccessRights); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } }