ARCed.Editor.GetContentFromPersistString C# (CSharp) Метод

GetContentFromPersistString() приватный статический Метод

Creates a window from a string representation of the original and returns it
It is important that any plug-in have a parameterless constructor, else it will fail to load from a saved layout.
private static GetContentFromPersistString ( string persistString ) : IDockContent
persistString string The string representation of the window
Результат IDockContent
        private static IDockContent GetContentFromPersistString(string persistString)
        {
            if (persistString == typeof(ScriptEditorForm).ToString())
            {
                if (Project.Settings.OpenScripts.Count > 0)
                {
                    string file = Project.Settings.OpenScripts[0];
                    Project.Settings.OpenScripts.RemoveAt(0);
                    return OpenScript(file);
                }
                return null;
            }
            if (persistString == typeof(FindReplaceDialog).ToString())
                return Windows.ScintillaFindReplace;
            if (persistString == typeof(ScriptStyleForm).ToString())
                return Windows.ScriptStyleMenu;
            if (persistString == typeof(ScriptMenuForm).ToString())
                return Windows.ScriptMenu;
            if (persistString == typeof(ARChiveForm).ToString())
                return Windows.ARChiveForm;
            if (persistString == typeof(EditorOptionsForm).ToString())
                return Windows.EditorOptionsMenu;
            if (persistString == typeof(SkinSettingsForm).ToString())
                return Windows.SkinSettingForm;
            if (persistString == typeof(AutoCompleteForm).ToString())
                return Windows.AutoCompleteWindow;

            // Attempt to create windows not defined, searching plug-in assemblies
            try
            {
                Type type = null;
                foreach (var assembly in ARCedAssemblies)
                {
                    type = assembly.GetType(persistString);
                    if (type != null)
                        break;
                }
                return (IDockContent)Activator.CreateInstance(type);
            }
            catch { return null; }
        }