private void GetFunctionNames(ContextPromptUpdateEventArgs e) { reader = new XmlTextReader(intellisensePath); function = ""; int i = 1; while (reader.Read()) { function = ""; switch (reader.NodeType) { case (XmlNodeType.Element): if (reader.Name == "Function") { reader.MoveToFirstAttribute(); if (reader.Value == this.contextPromptLexem) { while (reader.MoveToNextAttribute()) { if (reader.Name == "overloads" + i) { function = reader.Value; } else { if (reader.Name == "Description" + i) { e.AddPrompt(function, reader.Value); i++; } } } } } break; } } }
// Method that populates the context prompt list based on the lexem invoking it private void PopulateContextPromptItems(ContextPromptUpdateEventArgs e) { switch (this.contextPromptLexem) { case "Chat": e.List.Clear(); e.AddPrompt("Chat(string chatText, int senderID, int receiverID, int connectionID)", "Specify the chat text, the sender information, the receiver information and the connection ID"); e.AddPrompt("Chat(string chatText, int senderID, bool isBroadCast)", "Specify the chat text, the sender information, and if its a broadcast"); break; case "Database": e.List.Clear(); e.AddPrompt("Database()", "Create a new database"); e.AddPrompt("Database(string dataBaseName)", "Create a new database with the specified name"); break; case "NewFile": e.List.Clear(); e.AddPrompt("NewFile()", "Create a new file"); e.AddPrompt("NewFile(string fileName)", "Create a new file with the specified name"); break; case "Find": e.List.Clear(); e.AddPrompt("Find()", "Display the Find dialog"); e.AddPrompt("Find(string searchText)", "Find occurences of the specified search text"); e.AddPrompt("Find(string searchText, bool searchUp)", "Find occurences of the specified search text and search up if specified"); break; case "Home": e.List.Clear(); e.AddPrompt("Home()", "Go to the initial application form"); break; case "PieChart": e.List.Clear(); e.AddPrompt("PieChart()", "Create an empty Pie-chart"); e.AddPrompt("PieChart(string[] sectionNames, int[] sectionAngles)", "Create a Pie-chart containing the specified sections with the specified angles information"); e.AddPrompt("PieChart(string[] sectionNames, int[] sectionAngles, Color[] sectionColors)", "Create a Pie-chart containing the specified sections with the specified angles and color information"); break; case "Tools": e.List.Clear(); e.AddPrompt("Tools()", "Display the Tools dialog"); e.AddPrompt("Tools(int ToolID)", "Display the Tools dialog and select the specified Tool"); break; } }