Inheritance: ICompletionData
		public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
		{
			ICompletionData[] data = new ICompletionData[texts.Length];
			for (int i = 0; i < data.Length; i++) {
				data[i] = new DefaultCompletionData(texts[i], null, ClassBrowserIconService.GotoArrowIndex);
			}
			return data;
		}
Ejemplo n.º 2
0
        // enumerate all tables in our database and build a table/column hashtable for code completion
        void buildDataHT()
        {
            sqlConnection1.Open();
            DataTable dt = sqlConnection1.GetSchema("Columns");
            sqlConnection1.Close();

            string lasttbl = (string)dt.Rows[0][2];
            ICompletionData[] cd = new ICompletionData[1];
            int i = 0;
            int rc = 0; // rowcount

            foreach(DataRow dr in dt.Rows) {
                if((string)dr[2] == lasttbl) {
                    ICompletionData[] cdtemp = new ICompletionData[rc + 1];
                    cd.CopyTo(cdtemp, 0);
                    cd = cdtemp;
                    cd[rc] = new DefaultCompletionData((string)dr[3], (string)dr[7] + " " + (string)dr[3], 0);
                } else {
                    rc = 0;
                    htWordNet.Add(lasttbl, cd);
                    cd = new ICompletionData[1];
                    cd[rc] = new DefaultCompletionData((string)dr[3], (string)dr[7] + " " + (string)dr[3], 0);
                    lasttbl = (string)dt.Rows[i][2];
                }

                i ++;
                rc ++;
            }
        }