示例#1
0
        protected virtual void ApplyCase(UpdateParentTemplateParams prop)
        {
            string propertyBackingStore = GetPropertyBackingStore(prop.PropertyName);
            string parentObjExpression  = GetParentObjExpression(prop.IfType);

            this.WriteObjects("                case \"", prop.PropertyName, "\":");
            this.WriteLine();
            this.WriteObjects("                    {");
            this.WriteLine();
            this.WriteObjects("                        var __oldValue = ", propertyBackingStore, ";");
            this.WriteLine();
            this.WriteObjects("                        var __newValue = ", parentObjExpression, ";");
            this.WriteLine();
            this.WriteObjects("                        NotifyPropertyChanging(\"", prop.PropertyName, "\", __oldValue, __newValue);");
            this.WriteLine();
            this.WriteObjects("                        ", propertyBackingStore, " = __newValue;");
            this.WriteLine();
            this.WriteObjects("                        NotifyPropertyChanged(\"", prop.PropertyName, "\", __oldValue, __newValue);");
            this.WriteLine();
            this.WriteObjects("                    }");
            this.WriteLine();
            this.WriteObjects("                    break;");
            this.WriteLine();
        }
示例#2
0
        protected virtual void ApplyCase(UpdateParentTemplateParams prop)
        {
            string propertyBackingStore = GetPropertyBackingStore(prop.PropertyName);
            string parentObjExpression = GetParentObjExpression(prop.IfType);

            this.WriteObjects("                case \"", prop.PropertyName, "\":");
            this.WriteLine();
            this.WriteObjects("                    {");
            this.WriteLine();
            this.WriteObjects("                        var __oldValue = ", propertyBackingStore, ";");
            this.WriteLine();
            this.WriteObjects("                        var __newValue = ", parentObjExpression, ";");
            this.WriteLine();
            this.WriteObjects("                        NotifyPropertyChanging(\"", prop.PropertyName, "\", __oldValue, __newValue);");
            this.WriteLine();
            this.WriteObjects("                        ", propertyBackingStore, " = __newValue;");
            this.WriteLine();
            this.WriteObjects("                        NotifyPropertyChanged(\"", prop.PropertyName, "\", __oldValue, __newValue);");
            this.WriteLine();
            this.WriteObjects("                    }");
            this.WriteLine();
            this.WriteObjects("                    break;");
            this.WriteLine();
        }