Пример #1
0
        internal void OnShutdown(object sender, EventArgs e)
        {
            NppEventHandler ev = Shutdown;

            if (ev != null)
            {
                ev(this, e);
            }
        }
Пример #2
0
        internal void OnFileLoadFailed(object sender, EventArgs e)
        {
            NppEventHandler ev = FileLoadFailed;

            if (ev != null)
            {
                ev(this, e);
            }
        }
Пример #3
0
        internal void OnReady(object sender, EventArgs e)
        {
            NppEventHandler ev = Ready;

            if (ev != null)
            {
                ev(this, e);
            }
        }
Пример #4
0
        private void PickColor()
        {
            ColorDialog dlg = new ColorDialog();

            dlg.Color = _color != null ? (Color)_color : System.Drawing.Color.Black;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (dlg.Color != _color)
                {
                    _color = dlg.Color;
                    Invalidate();

                    NppEventHandler ev = ColorChanged;
                    if (ev != null)
                    {
                        ev(this, new EventArgs());
                    }
                }
            }
        }
Пример #5
0
        public ProbeNppPlugin()
        {
            try
            {
                _instance = this;
                _nppWindow = NppWindow;

                _settings = new Settings(this);
                try
                {
                    _settings.Load();
                }
                catch (Exception ex)
                {
                    Errors.Show(_nppWindow, ex, "Exception when attempting to load ProbeNpp settings.");
                }

                ProbeEnvironment.Initialize();
                ProbeEnvironment.AppChanged += new EventHandler(_env_AppChanged);

                TempManager.Init(Path.Combine(ConfigDir, "Temp"));

                LoadLexerConfig();

                _autoCompletionManager = new AutoCompletion.AutoCompletionManager();
                _smartIndentManager = new AutoCompletion.SmartIndentManager();

                Ready += new NppEventHandler(Plugin_Ready);
                Shutdown += new NppEventHandler(Plugin_Shutdown);
                FileOpened += new FileEventHandler(Plugin_FileOpened);
                FileClosed += new FileEventHandler(Plugin_FileClosed);
                FileActivated += new FileEventHandler(Plugin_FileActivated);
                FileSaved += new FileEventHandler(ProbeNppPlugin_FileSaved);
                LanguageChanged += new LanguageTypeEventHandler(Plugin_LanguageChanged);
                SelectionChanged += new NppEventHandler(Plugin_SelectionChanged);
                Modification += new ModifiedEventHandler(Plugin_Modification);

                CharAdded += new CharAddedEventHandler(ProbeNppPlugin_CharAdded);

                _fileBackground.Execute += new EventHandler(FileBackground_Execute);

                _functionFileScanner = new AutoCompletion.FunctionFileScanner();
                _fileScannerDefer.Execute += new EventHandler(FileScanner_Execute);
                _fileScannerDefer.Activity += new EventHandler(FileScanner_Activity);
            }
            catch (Exception ex)
            {
                Errors.Show(_nppWindow, ex, "The ProbeNpp plug-in thrown an error while initializing.");
            }
        }