Atomia.Provisioning.Modules.Folders.Commands.FoldersCommand.ExecuteAdd C# (CSharp) Метод

ExecuteAdd() защищенный Метод

Executes the add.
protected ExecuteAdd ( ModuleService moduleService ) : void
moduleService ModuleService The module service.
Результат void
        protected override void ExecuteAdd(ModuleService moduleService)
        {
            string rootFolder = this.resource["RootFolder"].ToString();
            if (rootFolder == "")
            {
                rootFolder = "c:\\ProvisioningModuleTestFolder\\";
            }

            if (rootFolder.Substring(rootFolder.Length - 1, 1) != "\\")
            {
                rootFolder += "\\";
            }

            string newFolderName = moduleService["Name"].ToString();

            if (!Directory.Exists(rootFolder))
            {
                Directory.CreateDirectory(rootFolder);
            }

            string newFolderFullPath = rootFolder + newFolderName;

            if (Directory.Exists(newFolderFullPath))
            {
                throw ExceptionHelper.GetModuleException("ID422008", null, null);
            }
            else
            {
                Directory.CreateDirectory(newFolderFullPath);
            }
        }