/// <summary> /// 设置PLC语言,并确定高亮关键字 /// </summary> static public void SetPLCLanguage() { Language dcs_lan = new Language(); foreach (string SunningKey in SunningCodes.Keys) { dcs_lan.Keywords += SunningKey + "\n"; } foreach (string Code in SpecialCode.Keys) { dcs_lan.Keywords += Code + "\n"; } dcs_lan.Operators = "&" + "\n" + "*"; dcs_lan.SingleLineComments = "//"; dcs_lan.MultiLineComments1 = "(*"; dcs_lan.MultiLineComments2 = "*)"; dcs_lan.ScopeKeywords1 = "{"; dcs_lan.ScopeKeywords2 = "}"; dcs_lan.EscapeChar = "\\"; Globals glo = new Globals(); glo.RegisterLanguage("DCSLan", dcs_lan); HotKey hotkey = new HotKey(); // 全选 hotkey.Modifiers1 = 0x02; hotkey.VirtKey1 = "A"; glo.RegisterHotKey(hotkey, cmCommand.cmCmdSelectAll); hotkey.Modifiers1 = 0x02; // 查找与替换 hotkey.VirtKey1 = "F"; glo.RegisterHotKey(hotkey, cmCommand.cmCmdFindReplace); }