Beispiel #1
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // check folders
            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Notepad X\\Plugins"))
                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Notepad X\\Plugins");
            FileFilterSettings.Load();
            new Program();

            MainForm mf = new MainForm();
            Application.Run(mf);

            // CLOSING
            FileFilterSettings.Save();
            foreach (NotepadX.Plugins.AvailablePlugin p in NotepadX.MainForm.PluginManager.AvailablePlugins)
            {
                bool a;
                if (p.Instance != null)
                    a = p.Instance.Dispose();
                else
                    a = p.MenuItem.Dispose();
                if (!a)
                    MessageBox.Show("Error disposing plugin '" + p.AssemblyPath + "'!");
            }
            foreach (string filename in FilesToDelete)
            {
                try {
                    File.Delete(filename);
                } catch (Exception) {

                }
            }
        }
Beispiel #2
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            Instance = this;

            // load plugins
            PluginManager.FindPlugins();

            // set up default extensions - TODO: move to plugin
            IExtendFramework.Text.FileExtensionManager.AddEditor(new DefaultExtensions.TXTEditor());
            IExtendFramework.Text.FileExtensionManager.AddEditor(new DefaultExtensions.NXMEditor());
            IExtendFramework.Text.FileExtensionManager.AddEditor(new DefaultExtensions.RTFEditor());
        }