GetCodeName() публичный Метод

public GetCodeName ( ) : string
Результат string
Пример #1
0
        public string GetCodeName()
        {
            string classType = _targetClass.GetCodeName();
            string result    = NameUtils.ToCodeName(XmlName, IsList);

            return((classType == result)
                ? NameUtils.ToCodeName(XmlName + "Prop", IsList)
                : result);
        }
Пример #2
0
        private void WriteImplicitStringCast(ClassInfo classInfo)
        {
            if (!classInfo.AllMembers.Any(m => m.IsElementValue && m.GetCodeType() == "string"))
            {
                return;
            }

            _writer.WriteLine("\t\tpublic override string ToString(){return Value;}");
            _writer.WriteLine("\t\tpublic static implicit operator string(" + classInfo.GetCodeName() + " obj){return obj.Value;}");
            _writer.WriteLine();
        }
Пример #3
0
        void WriteEqualityMembers(ClassInfo classInfo)
        {
            _writer.WriteLine(
            @"		public static bool operator ==({0} left, {0} right)
            {{
            return Utils.ValidatedEquals<Null{0}>(left, right);
            }}

            public static bool operator !=({0} left, {0} right)
            {{
            return !(left == right);
            }}", classInfo.GetCodeName());
        }
Пример #4
0
        void WriteEqualityMembers(ClassInfo classInfo)
        {
            _writer.WriteLine(
                @"		public static bool operator ==({0} left, {0} right)
		{{
			return Utils.ValidatedEquals<Null{0}>(left, right);
		}}

		public static bool operator !=({0} left, {0} right)
		{{
			return !(left == right);
		}}"        , classInfo.GetCodeName());
        }
Пример #5
0
        void WriteOriginalClass(ClassInfo classInfo)
        {
            _writer.WriteLine("\tpublic partial class {0}{1}\t{{", classInfo.GetCodeName(), Environment.NewLine);

            WriteAutoProperties(classInfo);
            _writer.WriteLine();

            WriteConstructors(classInfo);
            _writer.WriteLine();

            WriteEqualityMembers(classInfo);
            _writer.WriteLine("\t}}{0}", Environment.NewLine);
        }
Пример #6
0
 void WriteImplicitStringCast(ClassInfo classInfo)
 {
     _writer.WriteLine("\t\tpublic override string ToString(){return Value;}");
     _writer.WriteLine("\t\tpublic static implicit operator string(" + classInfo.GetCodeName() + " obj){return obj.Value;}");
     _writer.WriteLine();
 }
Пример #7
0
 void WriteEmptyConstructor(ClassInfo classInfo)
 {
     _writer.WriteLine("\t\tpublic {0}(){1}\t\t{{ }}", classInfo.GetCodeName(), Environment.NewLine);
 }
Пример #8
0
 void WriteXElementConstructor(ClassInfo classInfo, StreamWriter writer)
 {
     writer.WriteLine("\t\tpublic {0}(XElement element){1}\t\t{{", classInfo.GetCodeName(), Environment.NewLine);
     WritePropertyInitialisationStatements(classInfo, writer);
     writer.WriteLine("\t\t}");
 }
Пример #9
0
        void WriteOriginalClass(ClassInfo classInfo)
        {
            _writer.WriteLine("\tpublic partial class {0}{1}\t{{", classInfo.GetCodeName(), Environment.NewLine);

            WriteAutoProperties(classInfo);
            _writer.WriteLine();

            WriteConstructors(classInfo);
            _writer.WriteLine();

            WriteEqualityMembers(classInfo);
            _writer.WriteLine("\t}}{0}", Environment.NewLine);
        }
Пример #10
0
 void WriteNullClass(ClassInfo classInfo)
 {
     _writer.WriteLine("\tinternal class Null{0} : {0}{1}\t{{", classInfo.GetCodeName(), Environment.NewLine);
     GenerateThrowingProperties(classInfo);
     _writer.WriteLine("\t}}{0}", Environment.NewLine);
 }
Пример #11
0
        private void WriteImplicitStringCast(ClassInfo classInfo)
        {
            if (!classInfo.AllMembers.Any(m => m.IsElementValue && m.GetCodeType() == "string"))
                return;

            _writer.WriteLine("\t\tpublic override string ToString(){return Value;}");
            _writer.WriteLine("\t\tpublic static implicit operator string(" + classInfo.GetCodeName() + " obj){return obj.Value;}");
            _writer.WriteLine();
        }
Пример #12
0
 void WriteNullClass(ClassInfo classInfo)
 {
     _writer.WriteLine("\tinternal class Null{0} : {0}{1}\t{{", classInfo.GetCodeName(), Environment.NewLine);
     GenerateThrowingProperties(classInfo);
     _writer.WriteLine("\t}}{0}", Environment.NewLine);
 }
Пример #13
0
 void WriteImplicitStringCast(ClassInfo classInfo)
 {
     _writer.WriteLine("\t\tpublic override string ToString(){return Value;}");
     _writer.WriteLine("\t\tpublic static implicit operator string(" + classInfo.GetCodeName() + " obj){return obj.Value;}");
     _writer.WriteLine();
 }
Пример #14
0
 void WriteXElementConstructor(ClassInfo classInfo, StreamWriter writer)
 {
     writer.WriteLine("\t\tpublic {0}(XElement element){1}\t\t{{", classInfo.GetCodeName(), Environment.NewLine);
     WritePropertyInitialisationStatements(classInfo, writer);
     writer.WriteLine("\t\t}");
 }
Пример #15
0
 void WriteEmptyConstructor(ClassInfo classInfo)
 {
     _writer.WriteLine("\t\tpublic {0}(){1}\t\t{{ }}", classInfo.GetCodeName(), Environment.NewLine);
 }