From c3c38cef3f6d306a84ac5ab6c4d1bf3992e113b4 Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Thu, 21 Apr 2016 12:26:57 +0900 Subject: [PATCH 1/5] minor comment typo cleanup --- CodeGenDom/NativeInfo.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeGenDom/NativeInfo.cs b/CodeGenDom/NativeInfo.cs index bacffa1..b03cb03 100644 --- a/CodeGenDom/NativeInfo.cs +++ b/CodeGenDom/NativeInfo.cs @@ -8,7 +8,7 @@ namespace DomGen { - // strings found in the .xsd file and those added as tags to the DOM objects + // Strings found in the .xsd file and those added as tags to the DOM objects. public static class SchemaStrings { public const string LegeNativeType = "LeGe.NativeType"; @@ -115,8 +115,8 @@ public bool Getable } - // a native class in a class that can be instantiated by the native code. - // The class info stores the name of the class as well as inforamtion + // A native class in a class that can be instantiated by the native code. + // The class info stores the name of the class as well as information // about all the native properties and lists. public class NativeClassInfo { @@ -158,7 +158,7 @@ public List Lists } - // the native schema info contains all the inforation about + // The native schema info contains all the information about // classes, properties and list supported by the native code. public class NativeSchemaInfo { From af1b3332824b4ac365c59b6de500661230bf6437 Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Thu, 21 Apr 2016 12:28:07 +0900 Subject: [PATCH 2/5] nativepropertyinfo: c# auto-implemented properties --- CodeGenDom/NativeInfo.cs | 43 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/CodeGenDom/NativeInfo.cs b/CodeGenDom/NativeInfo.cs index b03cb03..b39314d 100644 --- a/CodeGenDom/NativeInfo.cs +++ b/CodeGenDom/NativeInfo.cs @@ -75,42 +75,45 @@ public class NativePropertyInfo { public NativePropertyInfo(XmlElement elm) { - string nativeName = elm.GetAttribute(SchemaStrings.NativeName); - string nativeType = elm.GetAttribute(SchemaStrings.NativeType); - string access = elm.GetAttribute(SchemaStrings.Access); - bool canSet = access.Contains(SchemaStrings.Set); - bool canGet = access.Contains(SchemaStrings.Get); - m_name = nativeName; - m_type = nativeType; - m_access = access; - m_setable = canSet; - m_getable = canGet; + NativeName = elm.GetAttribute(SchemaStrings.NativeName); + NativeType = elm.GetAttribute(SchemaStrings.NativeType); + Access = elm.GetAttribute(SchemaStrings.Access); + + bool canSet = true; + bool canGet = true; + if (!String.IsNullOrEmpty(Access)) + { + canSet = Access.Contains(SchemaStrings.Set); + canGet = Access.Contains(SchemaStrings.Get); + } + Setable = canSet; + Getable = canGet; } - private string m_name; public string NativeName { - get { return m_name; } + get; + private set; } - private string m_type; public string NativeType { - get { return m_type; } + get; + private set; } - private string m_access; public string Access { - get { return m_access; } + get; + private set; } - private bool m_setable; public bool Setable { - get { return m_setable; } + get; + private set; } - private bool m_getable; public bool Getable { - get { return m_getable; } + get; + private set; } } From 541ace17f90e08c511f958d110b93bbfa07f27ff Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Thu, 21 Apr 2016 12:28:33 +0900 Subject: [PATCH 3/5] nativelistinfo: c# auto-implemented properties --- CodeGenDom/NativeInfo.cs | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/CodeGenDom/NativeInfo.cs b/CodeGenDom/NativeInfo.cs index b39314d..ad32363 100644 --- a/CodeGenDom/NativeInfo.cs +++ b/CodeGenDom/NativeInfo.cs @@ -27,46 +27,44 @@ public class NativeListInfo { public NativeListInfo(XmlElement elm) { - string name = elm.GetAttribute(SchemaStrings.NativeName); - string type = elm.GetAttribute(SchemaStrings.NativeType); - string access = elm.GetAttribute(SchemaStrings.Access); + NativeName = elm.GetAttribute(SchemaStrings.NativeName); + NativeType = elm.GetAttribute(SchemaStrings.NativeType); + Access = elm.GetAttribute(SchemaStrings.Access); + bool canSet = true; bool canGet = true; - if (null != access) + if (!String.IsNullOrEmpty(Access)) { - canSet = access.Contains(SchemaStrings.Set); - canGet = access.Contains(SchemaStrings.Get); + canSet = Access.Contains(SchemaStrings.Set); + canGet = Access.Contains(SchemaStrings.Get); } - m_name = name; - m_type = type; - m_access = access; - m_setable = canSet; - m_getable = canGet; + Setable = canSet; + Getable = canGet; } - private string m_name; public string NativeName { - get { return m_name; } + get; + private set; } - private string m_type; public string NativeType { - get { return m_type; } + get; + private set; } - private string m_access; public string Access { - get { return m_access; } + get; + private set; } - private bool m_setable; public bool Setable { - get { return m_setable; } + get; + private set; } - private bool m_getable; public bool Getable { - get { return m_getable; } + get; + private set; } } From 588b4f6056c13283aef8859bb530b909bf1a1517 Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Thu, 21 Apr 2016 12:29:14 +0900 Subject: [PATCH 4/5] nativeclassinfo: c# auto-implemented properties --- CodeGenDom/NativeInfo.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CodeGenDom/NativeInfo.cs b/CodeGenDom/NativeInfo.cs index ad32363..a46f37a 100644 --- a/CodeGenDom/NativeInfo.cs +++ b/CodeGenDom/NativeInfo.cs @@ -123,23 +123,21 @@ public class NativeClassInfo { public NativeClassInfo(XmlElement element, bool abstractType) { - m_name = element.GetAttribute(SchemaStrings.NativeName); - m_abstract = abstractType; + NativeName = element.GetAttribute(SchemaStrings.NativeName); + Abstract = abstractType; m_properties = new List(); m_lists = new List(); } - - private string m_name; + public string NativeName { - get { return m_name; } - set { } + get; + private set; } - private bool m_abstract; public bool Abstract { - get { return m_abstract; } - set { } + get; + private set; } From aa1250f5739f203e65bd7754254e77899f5d97c5 Mon Sep 17 00:00:00 2001 From: Jetha Chan Date: Thu, 21 Apr 2016 12:30:03 +0900 Subject: [PATCH 5/5] nativeclassinfo: remove unused setters --- CodeGenDom/NativeInfo.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/CodeGenDom/NativeInfo.cs b/CodeGenDom/NativeInfo.cs index a46f37a..a6e5a85 100644 --- a/CodeGenDom/NativeInfo.cs +++ b/CodeGenDom/NativeInfo.cs @@ -145,14 +145,12 @@ public bool Abstract public List Properties { get { return m_properties; } - set { } } private List m_lists; public List Lists { get { return m_lists; } - set { } } }