private void GenerateField(Class @class, Field field)
    {
		var propertyName = field.GetDefaultPublicPropertyName();
		var propertyType = field.Type;
		var fieldName = field.Name;
		var changingEventArgs =  @class.Name + propertyName + "ChangingEventArgs";
		var changedEventArgs =   @class.Name + propertyName + "ChangedEventArgs";
		var attribute = field.Attributes.Find(a=>a.Name == "EventProperty");
		var generateAlwaysUpdate = GetBoolArgumentFromAttribute(attribute, "GenerateAlwaysUpdate");
		var generateSetters = GetBoolArgumentFromAttribute(attribute, "GenerateSetters");
		var generationMode = GetStringArgumentFromAttribute(attribute, "GenerationMode", EventPropertyAttribute.NotifyPropertyAndEventProperty);
        var generateReadOnly = GetBoolArgumentFromAttribute(attribute, "GenerateReadOnly");
		var fileName = attribute.FileName;
		var projectItem = Parser.GetProjectItem(fileName);
		var outputFileName = fileName.Replace(".cs", "." + propertyName + "EventProperty.g.cs");
		GenerateHeader();
		GenerateUsings(@class, new List<string> { "System", @class.Namespace.Name});

        
        #line default
        #line hidden
        
        #line 93 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("namespace ");

        
        #line default
        #line hidden
        
        #line 94 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(@class.Namespace.Name));

        
        #line default
        #line hidden
        
        #line 94 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\r\n{\r\n    public partial class ");

        
        #line default
        #line hidden
        
        #line 96 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(@class.Name));

        
        #line default
        #line hidden
        
        #line 96 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\r\n    {\r\n\t\t//private ");

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" in ");

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fileName));

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" (");

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(generationMode));

        
        #line default
        #line hidden
        
        #line 98 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(")\r\n");

        
        #line default
        #line hidden
        
        #line 99 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
         
		if (GenerateForEventProperty(generationMode))
		{
        
        #line default
        #line hidden
        
        #line 101 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("        \r\n\t\tpublic event EventHandler<");

        
        #line default
        #line hidden
        
        #line 102 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changingEventArgs));

        
        #line default
        #line hidden
        
        #line 102 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("> ");

        
        #line default
        #line hidden
        
        #line 102 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 102 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing;\r\n\t\tprivate void Invoke");

        
        #line default
        #line hidden
        
        #line 103 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 103 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing(");

        
        #line default
        #line hidden
        
        #line 103 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changingEventArgs));

        
        #line default
        #line hidden
        
        #line 103 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" e)\r\n        {\r\n            var handler = ");

        
        #line default
        #line hidden
        
        #line 105 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 105 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing;\r\n            if (handler != null) handler(this, e);\r\n        }\r\n\r\n    \t" +
        "public event EventHandler<");

        
        #line default
        #line hidden
        
        #line 109 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 109 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("> ");

        
        #line default
        #line hidden
        
        #line 109 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 109 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed;\r\n\t    private void Invoke");

        
        #line default
        #line hidden
        
        #line 110 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 110 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed(");

        
        #line default
        #line hidden
        
        #line 110 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 110 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" e)\r\n\t    {\r\n\t        var handler = ");

        
        #line default
        #line hidden
        
        #line 112 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 112 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed;\r\n\t        if (handler != null) handler(this, e);\r\n\t    }\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 116 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

		}
        
        #line default
        #line hidden
        
        #line 117 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\tpublic ");

        
        #line default
        #line hidden
        
        #line 118 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 118 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" ");

        
        #line default
        #line hidden
        
        #line 118 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 118 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\r\n        {\r\n            get { return ");

        
        #line default
        #line hidden
        
        #line 120 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 120 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("; }\r\n");

        
        #line default
        #line hidden
        
        #line 121 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    if (generateReadOnly)
	    {

        
        #line default
        #line hidden
        
        #line 124 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t        protected set\r\n");

        
        #line default
        #line hidden
        
        #line 126 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }
	    else
	    {

        
        #line default
        #line hidden
        
        #line 130 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t        set\r\n");

        
        #line default
        #line hidden
        
        #line 132 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }

        
        #line default
        #line hidden
        
        #line 134 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("            {\r\n                var old = ");

        
        #line default
        #line hidden
        
        #line 136 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 136 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(";\r\n");

        
        #line default
        #line hidden
        
        #line 137 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
		if (!generateAlwaysUpdate)
		{

        
        #line default
        #line hidden
        
        #line 140 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\t\t\tif (old == value)\r\n                    return;\r\n");

        
        #line default
        #line hidden
        
        #line 142 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
		}
        
        #line default
        #line hidden
        
        #line 142 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" \r\n                Update");

        
        #line default
        #line hidden
        
        #line 143 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 143 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("(old, value);\r\n            }\r\n        }\r\n\r\n        protected virtual void Update");

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("(");

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" old, ");

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 147 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" value)\r\n        {\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 150 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
		if (GenerateForEventProperty(generationMode))
		{

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\t\tvar changingEventArgs = new ");

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changingEventArgs));

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" { Old");

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = old, New");

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 153 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = value };\r\n\t\t\t\t\r\n\t\t\tOnBase");

        
        #line default
        #line hidden
        
        #line 155 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 155 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing(changingEventArgs);\r\n            if (changingEventArgs.Cancel)\r\n        " +
        "        return;\r\n\t\t\t\t\t\r\n\t\t\tInvoke");

        
        #line default
        #line hidden
        
        #line 159 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 159 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing(changingEventArgs);\r\n            if (changingEventArgs.Cancel)\r\n        " +
        "        return;\r\n\t\t\tvalue = changingEventArgs.New");

        
        #line default
        #line hidden
        
        #line 162 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 162 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(";\r\n");

        
        #line default
        #line hidden
        
        #line 163 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

		}
 
        
        #line default
        #line hidden
        
        #line 165 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\t    ");

        
        #line default
        #line hidden
        
        #line 166 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 166 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = value;\r\n\t\t\t\t\r\n");

        
        #line default
        #line hidden
        
        #line 168 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
		if (GenerateForEventProperty(generationMode))
		{

        
        #line default
        #line hidden
        
        #line 171 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("            var changedEventArgs = new ");

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" { Old");

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = old, New");

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 172 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = value };\r\n\t\t\tOnBase");

        
        #line default
        #line hidden
        
        #line 173 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 173 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed(changedEventArgs);\r\n            Invoke");

        
        #line default
        #line hidden
        
        #line 174 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 174 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed(changedEventArgs);\r\n");

        
        #line default
        #line hidden
        
        #line 175 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
        }
		if (GenerateForNotifyProperty(generationMode))
		{

        
        #line default
        #line hidden
        
        #line 179 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\t\tNotifyPropertyChanged(\"");

        
        #line default
        #line hidden
        
        #line 180 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 180 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\");\r\n");

        
        #line default
        #line hidden
        
        #line 181 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
		} 


        
        #line default
        #line hidden
        
        #line 183 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\t\t\r\n        }\r\n\t\r\n");

        
        #line default
        #line hidden
        
        #line 186 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
		if (GenerateForEventProperty(generationMode))
		{

        
        #line default
        #line hidden
        
        #line 189 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t\tpartial void OnBase");

        
        #line default
        #line hidden
        
        #line 189 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 189 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changing(");

        
        #line default
        #line hidden
        
        #line 189 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changingEventArgs));

        
        #line default
        #line hidden
        
        #line 189 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" e);\r\n\t\tpartial void OnBase");

        
        #line default
        #line hidden
        
        #line 190 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 190 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Changed(");

        
        #line default
        #line hidden
        
        #line 190 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 190 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" e);\r\n");

        
        #line default
        #line hidden
        
        #line 191 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
        }

		if (generateSetters)
		{

        
        #line default
        #line hidden
        
        #line 198 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    if (generateReadOnly)
	    {

        
        #line default
        #line hidden
        
        #line 201 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("      \r\n        protected ");

        
        #line default
        #line hidden
        
        #line 202 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }
	    else
	    {

        
        #line default
        #line hidden
        
        #line 206 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("      \r\n        public ");

        
        #line default
        #line hidden
        
        #line 207 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }
        
        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("void Set");

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Forced(");

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" new");

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 209 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(")\r\n\t\t{\r\n            Update");

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("(");

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(", new");

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 211 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(");\r\n\t\t}\r\n\r\n");

        
        #line default
        #line hidden
        
        #line 214 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    if (generateReadOnly)
	    {

        
        #line default
        #line hidden
        
        #line 217 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("      \r\n        protected ");

        
        #line default
        #line hidden
        
        #line 218 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }
	    else
	    {

        
        #line default
        #line hidden
        
        #line 222 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("      \r\n        public ");

        
        #line default
        #line hidden
        
        #line 223 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

	    }
        
        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("void Set");

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("Silently(");

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" new");

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 225 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(")\r\n\t\t{\r\n\t\t\t ");

        
        #line default
        #line hidden
        
        #line 227 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(fieldName));

        
        #line default
        #line hidden
        
        #line 227 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" = new");

        
        #line default
        #line hidden
        
        #line 227 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 227 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(";\r\n\t\t}\r\n");

        
        #line default
        #line hidden
        
        #line 229 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

		}

        
        #line default
        #line hidden
        
        #line 231 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\t}\r\n");

        
        #line default
        #line hidden
        
        #line 232 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
 
		if (GenerateForEventProperty(generationMode))
		{
	

        
        #line default
        #line hidden
        
        #line 236 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("    \r\n\tpublic class ");

        
        #line default
        #line hidden
        
        #line 238 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changingEventArgs));

        
        #line default
        #line hidden
        
        #line 238 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" : ");

        
        #line default
        #line hidden
        
        #line 238 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 238 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("\r\n    {\r\n        public bool Cancel { get; set; }\r\n    }\r\n\r\n    public class ");

        
        #line default
        #line hidden
        
        #line 243 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(changedEventArgs));

        
        #line default
        #line hidden
        
        #line 243 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(": EventArgs\r\n    {\r\n        public ");

        
        #line default
        #line hidden
        
        #line 245 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 245 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" New");

        
        #line default
        #line hidden
        
        #line 245 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 245 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" { get; set; }\r\n        public ");

        
        #line default
        #line hidden
        
        #line 246 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyType));

        
        #line default
        #line hidden
        
        #line 246 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" Old");

        
        #line default
        #line hidden
        
        #line 246 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(propertyName));

        
        #line default
        #line hidden
        
        #line 246 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write(" { get; set; }\r\n\t}\r\n");

        
        #line default
        #line hidden
        
        #line 248 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

        }
        
        #line default
        #line hidden
        
        #line 249 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"
this.Write("}\r\n");

        
        #line default
        #line hidden
        
        #line 251 "E:\Development\Crossbase\CrossBase.CodeGeneration\Templates\EventPropertyTemplate.tt"

		GenerateFooter();
		debugOutput += string.Format("Generated {0}\r\n", outputFileName);
		Delete(projectItem, outputFileName);
		Save(projectItem, outputFileName);
    }