public void Dispose()
        {
            if (autoClose != null)
            {
                Disable();
            }

            settings = null;
            enabled = false;
            abbreviations = null;
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            DisableMonitor();

            if (reformatterCode != null)
            {
                reformatterCode.Dispose();
                reformatterCode = null;
            }

            if (abbrevationCompletition != null)
            {
                abbrevationCompletition.Dispose();
                abbrevationCompletition = null;
            }

            if (ctrDoubleChar != null)
                ctrDoubleChar.Dispose();
        }
Exemplo n.º 3
0
        public void Dispose()
        {
            EventManager.RemoveEventHandler(this);

            disableFunctionAndNewClose();

            foreach (KeyValuePair<IntPtr, TabbedDocument> item in dict)
            {

                item.Value.SciControl.CharAdded -= new CharAddedHandler(SciControl_CharAdded);
                item.Value.SciControl.BeforeDelete -= new BeforeDeleteHandler(SciControl_BeforeDelete);

                item.Value.SciControl.ModEventMask ^= (Int32)ScintillaNet.Enums.ModificationFlags.BeforeDelete; ;
            }

            dict.Clear();

            abbreviations = null;
        }
Exemplo n.º 4
0
        private void DisableAbbrevation()
        {
            abbrevationCompletition.Dispose();

            if (settings.AbbrevationShortCut != Keys.None)
            {
                dictNotifyPressKey.Remove(settings.AbbrevationShortCut);
            }

            if (settings.AbbrevationPlusFormatterShortCut != Keys.None)
            {
                dictNotifyPressKey.Remove(settings.AbbrevationPlusFormatterShortCut);
            }

            if (settings.GenerateSensibleAreaShortCut != Keys.None)
            {
                dictNotifyPressKey.Remove(settings.GenerateSensibleAreaShortCut);
            }

            if (settings.GotoAbbreviationShortCut != Keys.None)
            {
                dictNotifyPressKey.Remove(settings.GotoAbbreviationShortCut);
            }

            DisactivateEventKey();
            //removeShortCutHandle(abbrevationCompletition);

            abbrevationCompletition = null;

            if (ctrDoubleChar == null) return;
            ctrDoubleChar.DisableCreateParameters();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Enable Abbrevation 
        /// </summary>
        private void EnableAbbreviation()
        {
            abbrevationCompletition = new Abbreviations(settings, vca);

            if (ctrDoubleChar != null)
                if (settings.CreateParameters)
                {
                    ctrDoubleChar.EnableCreateParameters(abbrevationCompletition);
                }

            // Active only if there is at least a short cut is active
            if (settings.AbbrevationShortCut != Keys.None || settings.AbbrevationPlusFormatterShortCut != Keys.None)
            {
                bool alreadyPresent = false;

                if (settings.AbbrevationShortCut != Keys.None)
                {
                    if (dictNotifyPressKey.ContainsKey(settings.AbbrevationShortCut))
                    {
                        alreadyPresent = true;
                        settings.abbrevationShortCut = Keys.None;

                    }
                    else
                        dictNotifyPressKey.Add(settings.AbbrevationShortCut, abbrevationCompletition);
                }

                if (settings.AbbrevationPlusFormatterShortCut != Keys.None)
                {
                    if (dictNotifyPressKey.ContainsKey(settings.AbbrevationPlusFormatterShortCut))
                    {
                        alreadyPresent = true;
                        settings.abbrevationPlusFormatterShortCut = Keys.None;

                    }
                    else
                        dictNotifyPressKey.Add(settings.AbbrevationPlusFormatterShortCut, abbrevationCompletition);
                }

                if (settings.GotoAbbreviationShortCut != Keys.None)
                {
                    if (dictNotifyPressKey.ContainsKey(settings.GotoAbbreviationShortCut))
                    {
                        alreadyPresent = true;
                        settings.gotoAbbreviationShortCut = Keys.None;

                    }
                    else
                        dictNotifyPressKey.Add(settings.GotoAbbreviationShortCut, abbrevationCompletition);
                }

                if (settings.GenerateSensibleAreaShortCut != Keys.None)
                {
                    if (dictNotifyPressKey.ContainsKey(settings.GenerateSensibleAreaShortCut))
                    {
                        alreadyPresent = true;
                        settings.generateSensibleAreaShortCut = Keys.None;

                    }
                    else
                        dictNotifyPressKey.Add(settings.GenerateSensibleAreaShortCut, abbrevationCompletition);
                }

                //insertShortCutHandle(abbrevationCompletition);

                if (alreadyPresent)
                    MessageBox.Show("Shorcut already in use in QuickGenerator!!\nPlease choose another Shorcut!!");

                ActivateEventKeys();
            }
        }
 public ControlShortCutAutoClose(QuickGenerator.Settings settings, Abbreviations abbreviations)
 {
     this.settings = settings;
     this.abbreviations = abbreviations;
 }