Пример #1
0
        //---------------------------------------------------------------------

        private ExtensionMain[] LoadExtensions(ExtensionAndInitFile[] extensions)
        {
            ExtensionMain[] loadedExtensions = new ExtensionMain[extensions.Length];
            foreach (int i in Indexes.Of(extensions))
            {
                ExtensionAndInitFile extensionAndInitFile = extensions[i];
                ui.WriteLine("Loading {0} extension ...", extensionAndInitFile.Info.Name);
                ExtensionMain loadedExtension = Loader.Load <ExtensionMain>(extensionAndInitFile.Info);
                loadedExtension.LoadParameters(extensionAndInitFile.InitFile, this);

                loadedExtensions[i] = loadedExtension;

                disturbAndOtherExtensions.Add(loadedExtension);
            }
            return(loadedExtensions);
        }
Пример #2
0
        //---------------------------------------------------------------------

        private void OutputExtensionInfo(ExtensionAndInitFile succession,
                                         ExtensionAndInitFile[] disturbances,
                                         ExtensionAndInitFile[] otherExtensions)
        {
            string toDisplay = "Using the following extensions ...\n";
            string format    = "   {0,-25} {1,-25}\n";

            toDisplay += string.Format(format, "Extension Name", "Extension Filename");
            toDisplay += string.Format(format, "--------------", "------------------");

            toDisplay += string.Format(format, succession.Info.Name, succession.InitFile);

            foreach (ExtensionAndInitFile extension in disturbances)
            {
                toDisplay += string.Format(format, extension.Info.Name, extension.InitFile);
            }

            foreach (ExtensionAndInitFile extension in otherExtensions)
            {
                toDisplay += string.Format(format, extension.Info.Name, extension.InitFile);
            }

            ui.WriteLine("{0}", toDisplay);
        }