예제 #1
0
        public SettingsForm(ProbeNppPlugin plugin)
        {
            if (plugin == null) throw new ArgumentNullException("plugin is null.");
            _plugin = plugin;

            InitializeComponent();
        }
예제 #2
0
        public CompilePanel(ProbeNppPlugin plugin)
        {
            if (plugin == null) throw new ArgumentNullException("plugin");
            _plugin = plugin;

            InitializeComponent();
        }
예제 #3
0
 public Settings(ProbeNppPlugin plugin)
 {
     try
     {
         if (plugin == null) throw new ArgumentNullException("plugin is null");
         _plugin = plugin;
     }
     catch (Exception ex)
     {
         if (_plugin != null) Plugin.Output.WriteLine(OutputStyle.Error, "Exception when initializing settings object: {0}", ex);
     }
 }
예제 #4
0
        public SidebarForm(ProbeNppPlugin plugin)
        {
            _plugin = plugin;

            InitializeComponent();

            if (_plugin.Settings.FileListView.FileColumnWidth > 0) colFileTitle.Width = _plugin.Settings.FileListView.FileColumnWidth;
            if (_plugin.Settings.FileListView.DirColumnWidth > 0) colFileDir.Width = _plugin.Settings.FileListView.DirColumnWidth;

            if (_plugin.Settings.FunctionListView.FunctionColumnWidth > 0) colFunctionName.Width = _plugin.Settings.FunctionListView.FunctionColumnWidth;

            _functionListWait = new BackgroundDeferrer();
            _functionListWait.Execute += new EventHandler(FunctionListWait_Execute);

            lstFunctions.DrawItem += new DrawListViewItemEventHandler(lstFunctions_DrawItem);
            lstFunctions.DrawSubItem += new DrawListViewSubItemEventHandler(lstFunctions_DrawSubItem);
            lstFunctions.DrawColumnHeader += new DrawListViewColumnHeaderEventHandler(lstFunctions_DrawColumnHeader);

            _loaded = true;
        }
예제 #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.");
            }
        }