public static void WriteDeclaration(Guid id, string name, int?indentation, string nodeType, string sourceType, bool anyRelevantProperties, CSideWriter writer) { var debt = 0; var nodeID = BuildNodePart(id.ToString("B").ToUpper(), 38, ref debt); var nodeIndentation = BuildNodePart(indentation.AsString(), 2, ref debt); var nodeName = BuildNodePart(name, 20, ref debt); var nodeTypeText = BuildNodePart(nodeType, 8, ref debt); var sourceTypeText = BuildNodePart(sourceType, 8, ref debt); var declaration1 = string.Format("{{ [{0}];{1};", nodeID, nodeIndentation); var declaration2 = string.Format("{0};{1};{2}", nodeName, nodeTypeText, sourceTypeText); writer.Write(declaration1); writer.Indent(writer.Column); writer.Write(declaration2); writer.WriteLineIf(anyRelevantProperties, ";"); writer.WriteIf(!anyRelevantProperties, " "); }
public static void Write(this MenuItemRunObjectTypeProperty property, bool isLastProperty, PropertiesStyle style, CSideWriter writer) { writer.Write("{0}={1}", property.Name, FormatMenuItemRunObjectType(property.Value.Value)); writer.WriteIf(isLastProperty, " "); writer.WriteLineIf(!isLastProperty, ";"); }