Example #1
0
        public static string GetModuleName(Type type, CoreType coreType)
        {
            if (!type.Name.EndsWith(coreType.ToString()))
            {
                throw new CoreException(string.Format("[Core.GetModuleName]The {0} : {1} is not end with \"{2}\" ", coreType.ToString().ToLower(), type.Name, coreType.ToString()));
            }
            int length = type.Name.Length;

            return(type.Name.Substring(0, length - coreType.ToString().Length));
        }
        public void ExportXml(ref XmlWriter xml)
        {
            xml.WriteStartElement("node");
            xml.WriteAttributeString("name", Name);
            xml.WriteAttributeString("type", CoreType.ToString());

            // tail must be joined because xml doesn't support duplicate attributes
            if (Tail.Count > 0)
            {
                xml.WriteAttributeString("metadata", string.Join(",", Tail));
            }

            ExportXmlImpl(ref xml);

            xml.WriteFullEndElement();
        }