Exemplo n.º 1
0
 private void WritePropertyGet(StructuralProperty property)
 {
     _("get");
     using (_builder.IndentBraced)
     {
         _("return {0};", property.FieldName);
     }
 }
Exemplo n.º 2
0
        private void Write(StructuralProperty property)
        {
            WriteDeclaration(property);

            using (_builder.IndentBraced)
            {
                WritePropertyGet(property);

                WritePropertySet(property);
            }
        }
Exemplo n.º 3
0
 private void WritePropertySet(StructuralProperty property)
 {
     _("set");
     using (_builder.IndentBraced)
     {
         _("if (value != {0})", property.FieldName);
         using (_builder.IndentBraced)
         {
             _("{0} = value;", property.FieldName);
             _("OnPropertyChanged(\"{0}\");", property.ModelName);
         }
     }
 }
Exemplo n.º 4
0
        private void Write(StructuralProperty property)
        {
            WriteDeclaration(property);

            using (_builder.IndentBraced)
            {
                WritePropertyGet(property);

                WritePropertySet(property);
            }
        }
Exemplo n.º 5
0
 private void WritePropertyGet(StructuralProperty property)
 {
     _("get");
     using (_builder.IndentBraced)
     {
         _("return {0};", property.FieldName);
     }
 }
Exemplo n.º 6
0
 private void WritePropertySet(StructuralProperty property)
 {
     _("set");
     using (_builder.IndentBraced)
     {
         _("if (value != {0})", property.FieldName);
         using (_builder.IndentBraced)
         {
             _("{0} = value;", property.FieldName);
             _("OnPropertyChanged(\"{0}\");", property.ModelName);
         }
     }
 }
Exemplo n.º 7
0
 public static StructuralProperty AsConcreteStructuralProperty(OdcmProperty odcmProperty)
 {
     return(odcmProperty.IsCollection
         ? StructuralCollectionProperty.ForConcrete(odcmProperty)
         : StructuralProperty.ForConcrete(odcmProperty));
 }