AGS.Plugin.Lua.LuaScriptFolderInfo.EnsureExistence C# (CSharp) Метод

EnsureExistence() публичный Метод

public EnsureExistence ( ) : void
Результат void
        public void EnsureExistence()
        {
            if (parent != null)
            {
                parent.EnsureExistence();
            }
            if (!dir.Exists)
            {
                dir.Create();
            }
        }

Usage Example

 void IEditorComponent.RefreshDataFromGame()
 {
     MainForm = Application.OpenForms[0];
     // Copy to new list because something else may be modifying editPanes in another thread(?)
     foreach (LuaScriptEditPane pane in new List<LuaScriptEditPane>(editPanes.Values))
     {
         editor.GUIController.RemovePaneIfExists(pane.contentDocument);
     }
     editPanes.Clear();
     if (IsPluginEnabled)
     {
         scripts.Clear();
         compileTimeScripts.Clear();
         ClearScriptFolders();
         rootScriptFolder = new LuaScriptFolderInfo(this, null, new DirectoryInfo(lscriptsdir));
         rootScriptFolder.EnsureExistence();
         RefreshProjectTree();
         if (restoredScriptsInfo != null)
         {
             rootScriptFolder.UpdateFromXml(restoredScriptsInfo);
             restoredScriptsInfo = null;
         }
         if (restoredCompileScripts != null)
         {
             foreach (string key in restoredCompileScripts)
             {
                 LuaScriptFileInfo script;
                 if (scripts.TryGetValue(key, out script))
                 {
                     compileTimeScripts.Add(script);
                 }
                 else
                 {
                     MessageBox.Show("Cannot find script " + key + " for Compile-Time Action");
                 }
             }
             restoredCompileScripts = null;
         }
         RefreshCompileTimeScripts();
     }
 }