Example #1
0
 private void ChromeBrowser_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         QuickSettings.Show(new Point(Cursor.Position.X, Cursor.Position.Y));
     }
 }
        public AbbrevationCompletionForm(QuickSettings.settingAbbrevation settings, VocabularyArgument vocabulary)
        {
            InitializeComponent();

            vocabularyArgument = vocabulary;
            if (vocabularyArgument == null) vocabularyArgument = new VocabularyArgument();

            foreach (string item in vocabularyArgument.ListArguments)
            {

                lstPlaceHolder.Items.Add(item);

            }

            fontArguments = new Font("Verdana", 8, FontStyle.Bold);
            fontTxtExpanded = txtExpandesText.SelectionFont;

            Dictionary<string, Dictionary<string, AbbrevationSnippet>> abbrevation = settings.AbbrevationDictionary;

            cst = new CustomCompletionListTextBoxAbbreviation(txtExpandesText, this);

            if (abbrevation != null)
            {
                cmbLanguage.Items.Clear();
                String ext="";

                int i=-1;
                if (ASContext.Context.CurrentFile != null)
                {
                    ext = System.IO.Path.GetExtension(ASContext.Context.CurrentFile).ToLower(); ;
                }
                foreach (KeyValuePair<string, Dictionary<string, AbbrevationSnippet>> dict in abbrevation)
                {

                    if (dict.Key == ".other") continue;
                    i++;
                    if (dict.Key == ext) indexCmbLanguage = i;
                    cmbLanguage.Items.Add(dict.Key.Substring(1));
                }

                cmbLanguage.Items.Add("other");

                if (indexCmbLanguage != -1)
                { cmbLanguage.SelectedIndex = indexCmbLanguage; }
                else
                {
                    indexCmbLanguage = cmbLanguage.Items.Count - 1;
                }
                dictAbbrevations = abbrevation;
            }
            //else
            //{

            //    dictAbbrevations = new Dictionary<string, Dictionary<string, AbbrevationSnippet>>();

            //    for (int i = 0; i < cmbLanguage.Items.Count; i++)
            //    {
            //        Dictionary<string, AbbrevationSnippet> abbreviatonsTemp = new Dictionary<string, AbbrevationSnippet>();
            //        dictAbbrevations.Add("." + ((string)cmbLanguage.Items[i]).ToLower(), abbreviatonsTemp);
            //    }

            //    indexCmbLanguage = 0;

            //    //AbbrevationSnippet abr = new AbbrevationSnippet("for(var ${var=\"i\" list=\"ls3\"}:int=0; ${var=\"i\"} < ${\"length\"}; ${var=\"i\"}++)\r\n{\r\n\t${SafeZone}\r\n}");
            //    //abr.Arguments = new WordTypes[5];
            //    //abr.Arguments[0] = WordTypes.var;
            //    //abr.Arguments[1] = WordTypes.var;
            //    //abr.Arguments[2] = WordTypes.place;
            //    //abr.Arguments[3] = WordTypes.var;
            //    //abr.Arguments[4] = WordTypes.SafeZone;

            //    //dictAbbrevations[".as"].Add("fori", abr);

            //    //abr = new AbbrevationSnippet("${list=\"ls1\"} function ${var=\"name\"}(${\"\"}):void\r\n{\r\n\t${SafeZone}\r\n}");
            //    //abr.Arguments = new WordTypes[4];
            //    //abr.Arguments[0] = WordTypes.list;
            //    //abr.Arguments[1] = WordTypes.var;
            //    //abr.Arguments[2] = WordTypes.place;
            //    //abr.Arguments[3] = WordTypes.SafeZone;

            //    //dictAbbrevations[".as"].Add("fnc", abr);

            //    //abr = new AbbrevationSnippet("var ${var=\"request\"}:${Import=\"URLRequest\"} = new URLRequest(${browser});\r\nvar ${var=\"loader\"}:Loader = new ${Import=\"Loader\"}();\r\n${var=\"loader\"}.contentLoaderInfo.addEventListener(${Import=\"Event\"}.COMPLETE, ${EventHandler=\"completeHandler\"});\r\n${var=\"loader\"}.load(${var=\"request\"});");
            //    //abr.Arguments = new WordTypes[10];
            //    //abr.Arguments[0] = WordTypes.var;
            //    //abr.Arguments[1] = WordTypes.import;
            //    //abr.Arguments[2] = WordTypes.browser;
            //    //abr.Arguments[3] = WordTypes.var;
            //    //abr.Arguments[4] = WordTypes.import;
            //    //abr.Arguments[5] = WordTypes.var;
            //    //abr.Arguments[6] = WordTypes.import;
            //    //abr.Arguments[7] = WordTypes.EventHandler;
            //    //abr.Arguments[8] = WordTypes.var;
            //    //abr.Arguments[9] = WordTypes.var;
            //    //abr.HasImport = true;
            //    //abr.HasEventHandler = true;
            //    //dictAbbrevations[".as"].Add("load", abr);
            //    ////dictAbbrevations[".as"].Add("vr", new AbbrevationSnippet("${list=0}var ${cursor}:${showCompType};"));

            //    //abr = new AbbrevationSnippet("${list=\"ls2\"} ${\"a\"}:${cmp=\"Number\"} = ${\"0\"};");
            //    //abr.Arguments = new WordTypes[4];
            //    //abr.Arguments[0] = WordTypes.list;
            //    //abr.Arguments[1] = WordTypes.place;
            //    //abr.Arguments[2] = WordTypes.cmp;
            //    //abr.Arguments[3] = WordTypes.place;

            //    //dictAbbrevations[".as"].Add("vr", abr);

            //    //abr = new AbbrevationSnippet("var ${\"mc\"}:${var=\"MovieClip\" showCmp} = new ${var=\"MovieClip\"}(${createParameters});");
            //    //abr.Arguments = new WordTypes[4];
            //    //abr.Arguments[0] = WordTypes.place;
            //    //abr.Arguments[1] = WordTypes.var;
            //    //abr.Arguments[2] = WordTypes.var;
            //    //abr.Arguments[3] = WordTypes.createParameters;

            //    //dictAbbrevations[".as"].Add("nw", abr);

            //    //abr = new AbbrevationSnippet("${var=\"name\"}(${createParameters});${AfterCurrentMember=\"fnc\"}");
            //    //abr.Arguments = new WordTypes[3];
            //    //abr.Arguments[0] = WordTypes.var;
            //    //abr.Arguments[1] = WordTypes.createParameters;
            //    //abr.Arguments[2] = WordTypes.AfterCurrentMember;
            //    //abr.HasAfterCurrentMember = true;
            //    //dictAbbrevations[".as"].Add("out", abr);

            //    //settings.AbbrevationDictionary = dictAbbrevations;
            //}

            //if (settings.CustomList == null)
            //{
            //    settings.CustomList = new Dictionary<string, List<string>>();
            //    List<string> ls = new List<string>();
            //    ls.Add("public");
            //    ls.Add("private");
            //    ls.Add("protected");
            //    settings.CustomList.Add("ls1", ls);
            //    ls = new List<string>();
            //    ls.Add("var");
            //    ls.Add("public var");
            //    ls.Add("private var");
            //    settings.CustomList.Add("ls2", ls);

            //     ls = new List<string>();
            //    ls.Add("x");
            //    ls.Add("y");
            //    ls.Add("z");
            //    settings.CustomList.Add("ls3", ls);
            //}
            _settings = settings;

            chkColorArgument.Checked = settings.ColorArgument;

            if(settings.ColorArgument)
                this.txtExpandesText.TextChanged += new System.EventHandler(this.txtExpandesText_TextChanged);
        }
Example #3
0
 public void CallQuickSettings()
 {
     QuickSettings.Show(new Point(Cursor.Position.X, Cursor.Position.Y));
 }