private void createPlaceholder(PlaceholderInfo info, ITcSmTreeItem plcProject, IWorker worker) { worker.ProgressStatus = string.Format("Adding Placeholder '{0}' ...", info.PlaceholderName); ITcSmTreeItem referencesItem = plcProject.LookupChild("References"); ITcPlcLibraryManager libraryManager = (ITcPlcLibraryManager)referencesItem; libraryManager.AddPlaceholder(info.PlaceholderName); }
/* =============================================================================================== * Helper method to iterate over all child nodes of Plc\PlcObjects in Orders.xml * =============================================================================================== */ private void addPlcElements(ref List <PlcObjectInfo> list, XmlNodeList xmlElements) { if (xmlElements != null) { foreach (XmlElement element in xmlElements) { PlcObjectType type = (PlcObjectType)Enum.Parse(typeof(PlcObjectType), element.Attributes["type"].Value); PlcObjectInfo info = null; switch (type) { case PlcObjectType.Library: info = new LibraryInfo(element); break; case PlcObjectType.Placeholder: info = new PlaceholderInfo(element); break; case PlcObjectType.DataType: info = new DataTypeInfo(element); break; case PlcObjectType.POU: info = new POUInfo(element); break; case PlcObjectType.Itf: info = new ItfInfo(element); break; case PlcObjectType.Gvl: info = new GvlInfo(element); break; default: Debug.Fail(""); break; } if (info != null) { list.Add(info); } } } }