/// <summary> /// Method builds a C# file RibbonItems.Designer.cs /// </summary> /// <param name="path">RibbonMarkup.xml with path</param> public void Execute(string path, RibbonParser parser) { //string @namespace = System.Reflection.Assembly.GetEntryAssembly().EntryPoint.DeclaringType.Namespace; if (File.Exists(path)) { string directory = Path.GetDirectoryName(path); string xmlFileName = Path.GetFileNameWithoutExtension(path); char last = xmlFileName[xmlFileName.Length - 1]; if (Char.IsNumber(last)) { ribbonItemsClass = RibbonItems + last.ToString(); } else { ribbonItemsClass = RibbonItems; } RibbonParser.ParseResult results = parser.Results; #if OldCode pair1List = (results.Pair1List); pair2List = (results.Pair2List); pair3List = (results.Pair3List); popupCommandNames = (results.PopupCommandNames); #else popupCommandNames = new List <string>(); #endif ribbonItems = results.RibbonItems; hasHFile = results.HasHFile; SetStreamWriter(directory); WriteCodeFile(); } }
public ParseResult(RibbonParser parser) { Pair1List = parser.pair1List.AsReadOnly(); Pair2List = parser.pair2List.AsReadOnly(); Pair3List = parser.pair3List.AsReadOnly(); PopupCommandNames = parser.popupCommandNames.AsReadOnly(); HasHFile = parser.hasHFile; AllApplicationModes = parser.allApplicationModes; RibbonItems = parser.ribbonItems.AsReadOnly(); }