} // proc WriteType public void WriteItem(DEListItemWriter xml, object item) { var caItem = (KeyValuePair <string, DEConfigAction>)item; var ca = caItem.Value; xml.WriteStartProperty("action"); xml.WriteAttributeProperty("id", caItem.Key); xml.WriteAttributeProperty("description", ca.Description); xml.WriteAttributeProperty("safecall", ca.IsSafeCall.ToString()); xml.WriteAttributeProperty("security", ca.SecurityToken); xml.WriteAttributeProperty("return", ca.MethodDescription.ReturnType.ToString()); xml.WriteStartProperty("arguments"); foreach (var p in ca.MethodDescription.GetParameters()) { xml.WriteStartProperty("argument"); xml.WriteAttributeProperty("name", p.Name); xml.WriteAttributeProperty("type", LuaType.GetType(p.ParameterType).AliasOrFullName); if (p.DefaultValue != null) { xml.WriteValue(p.DefaultValue); } xml.WriteEndProperty(); } xml.WriteEndProperty(); xml.WriteEndProperty(); } // proc WriteItem
} // func GetLogLineType public void WriteItem(DEListItemWriter xml, object item) { var logLine = (DELogLine)item; xml.WriteStartProperty("line"); xml.WriteAttributeProperty("stamp", logLine.Stamp.ToString("O")); xml.WriteAttributeProperty("typ", GetLogLineType(logLine.Typ)); xml.WriteValue(logLine.Text); xml.WriteEndProperty(); } // proc WriteItem
} // proc WriteType public void WriteItem(DEListItemWriter xml, object item) { xml.WriteStartProperty(sTypeName); for (int i = 0; i < properties.Count; i++) { string sName = properties[i].Key.Name; object value = properties[i].Value.GetValue(item); if (sName == ".") { xml.WriteValue(value); } else if (sName.StartsWith("@")) { xml.WriteAttributeProperty(sName.Substring(1), value); } else { xml.WriteElementProperty(sName, value); } } xml.WriteEndProperty(); } // proc WriteItem