Explorar el Código

Merge branch 'auto_properties' into frank

frankvandenbos hace 1 año
padre
commit
8022cf6ed1

+ 6 - 0
prs.classes/AssemblyInfo.cs

@@ -0,0 +1,6 @@
+using AutoProperties;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+[assembly: BypassAutoPropertySettersInConstructors(true)]

+ 2 - 0
prs.classes/Entities/Job/Job.cs

@@ -1,6 +1,7 @@
 using System;
 using System.ComponentModel;
 using System.Linq.Expressions;
+using AutoProperties;
 using InABox.Core;
 
 namespace Comal.Classes
@@ -174,6 +175,7 @@ namespace Comal.Classes
 
         [DoNotPersist]
         [DoNotSerialize]
+        [InterceptIgnore]
         public static String JobNumberPrefix { get; set; }
 
         public Expression<Func<Job, string>> AutoIncrementField() => x => x.JobNumber;

+ 2 - 0
prs.classes/Entities/PurchaseOrder/PurchaseOrder.cs

@@ -4,6 +4,7 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Runtime.InteropServices;
 using System.Xml.Linq;
+using AutoProperties;
 using InABox.Clients;
 using InABox.Core;
 
@@ -219,6 +220,7 @@ namespace Comal.Classes
 
         [DoNotPersist]
         [DoNotSerialize]
+        [InterceptIgnore]
         public static string PONumberPrefix { get; set; }
 
         [NullEditor]

+ 1 - 2
prs.classes/Entities/Stock/StockMovement/StockMovement.cs

@@ -292,8 +292,7 @@ namespace Comal.Classes
                 bChanging = false;
             }
 
-            else
-                base.DoPropertyChanged(name, before, after);
+            base.DoPropertyChanged(name, before, after);
         }
     }
 }

+ 2 - 1
prs.classes/FodyWeavers.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
-  <PropertyChanged />
+	<AutoProperties/>
+	<PropertyChanged />
 </Weavers>

+ 1 - 0
prs.classes/FodyWeavers.xsd

@@ -53,6 +53,7 @@
             </xs:attribute>
           </xs:complexType>
         </xs:element>
+        <xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
       </xs:all>
       <xs:attribute name="VerifyAssembly" type="xs:boolean">
         <xs:annotation>

+ 1 - 0
prs.classes/PRSClasses.csproj

@@ -31,6 +31,7 @@
     </ItemGroup>
 
     <ItemGroup>
+      <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
       <PackageReference Include="Fody" Version="6.8.1" PrivateAssets="All">
         <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       </PackageReference>

+ 4 - 1
prs.desktop/AssemblyInfo.cs

@@ -1,3 +1,4 @@
+using AutoProperties;
 using System.Windows;
 
 [assembly: ThemeInfo(
@@ -7,4 +8,6 @@ using System.Windows;
     ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
     //(used if a resource is not found in the page,
     // app, or any theme specific resource dictionaries)
-)]
+)]
+
+[assembly: BypassAutoPropertySettersInConstructors(true)]

+ 4 - 1
prs.desktop/FodyWeavers.xml

@@ -1 +1,4 @@
-<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd" />
+<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
+	<AutoProperties/>
+	<PropertyChanged/>
+</Weavers>

+ 52 - 1
prs.desktop/FodyWeavers.xsd

@@ -3,7 +3,58 @@
   <!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
   <xs:element name="Weavers">
     <xs:complexType>
-      <xs:all></xs:all>
+      <xs:all>
+        <xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1">
+          <xs:complexType>
+            <xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="TriggerDependentProperties" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="EventInvokerNames" type="xs:string">
+              <xs:annotation>
+                <xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="CheckForEquality" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="SuppressWarnings" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+            <xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
+              <xs:annotation>
+                <xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
+              </xs:annotation>
+            </xs:attribute>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
+      </xs:all>
       <xs:attribute name="VerifyAssembly" type="xs:boolean">
         <xs:annotation>
           <xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>

+ 2 - 0
prs.desktop/PRSDesktop.csproj

@@ -847,6 +847,7 @@
     </ItemGroup>
 
     <ItemGroup>
+      <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
       <PackageReference Include="bblanchon.PDFium.Win32" Version="127.0.6504" />
       <PackageReference Include="DeviceId.Windows.Wmi" Version="6.2.0" />
       <PackageReference Include="Dirkster.AvalonDock" Version="4.72.1" />
@@ -863,6 +864,7 @@
       <PackageReference Include="NDesk.Options.Core" Version="1.2.8" />
       <PackageReference Include="net.sf.mpxj" Version="12.10.1" />
       <PackageReference Include="OpenExchangeRates.NET" Version="1.3.0" />
+      <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
       <PackageReference Include="Scriban" Version="5.10.0" />
       <PackageReference Include="SharpAvi" Version="3.0.1" />
       <PackageReference Include="Syncfusion.DataGridExcelExport.Wpf" Version="25.2.6" />

+ 2 - 0
prs.licensing/AssemblyInfo.cs

@@ -1,3 +1,4 @@
+using AutoProperties;
 using System.Windows;
 
 [assembly: ThemeInfo(
@@ -8,3 +9,4 @@ using System.Windows;
                                               //(used if a resource is not found in the page,
                                               // app, or any theme specific resource dictionaries)
 )]
+[assembly: BypassAutoPropertySettersInConstructors(true)]

+ 2 - 1
prs.licensing/FodyWeavers.xml

@@ -1,3 +1,4 @@
 <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
-  <PropertyChanged />
+	<AutoProperties/>
+	<PropertyChanged />
 </Weavers>

+ 1 - 0
prs.licensing/PRSLicensing.csproj

@@ -22,6 +22,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
     <PackageReference Include="Fody" Version="6.8.1">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

+ 0 - 1
prs.mobile.new/PRS.Mobile.Droid/Resources/Resource.designer.cs

@@ -2,7 +2,6 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.

+ 1 - 0
prs.mobile.new/PRS.Mobile/FodyWeavers.xsd

@@ -53,6 +53,7 @@
             </xs:attribute>
           </xs:complexType>
         </xs:element>
+        <xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
       </xs:all>
       <xs:attribute name="VerifyAssembly" type="xs:boolean">
         <xs:annotation>

+ 1 - 0
prs.mobile.new/PRS.Mobile/PRS.Mobile.csproj

@@ -13,6 +13,7 @@
     </PropertyGroup>
 
     <ItemGroup>
+        <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
         <PackageReference Include="Fody" Version="6.8.1">
           <PrivateAssets>all</PrivateAssets>
           <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

+ 6 - 0
prs.server/AssemblyInfo.cs

@@ -0,0 +1,6 @@
+using AutoProperties;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+[assembly: BypassAutoPropertySettersInConstructors(true)]

+ 2 - 1
prs.server/FodyWeavers.xml

@@ -1,3 +1,4 @@
 <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
-  <PropertyChanged />
+	<AutoProperties/>
+	<PropertyChanged />
 </Weavers>

+ 1 - 0
prs.server/FodyWeavers.xsd

@@ -53,6 +53,7 @@
             </xs:attribute>
           </xs:complexType>
         </xs:element>
+        <xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
       </xs:all>
       <xs:attribute name="VerifyAssembly" type="xs:boolean">
         <xs:annotation>

+ 1 - 0
prs.server/PRSServer.csproj

@@ -78,6 +78,7 @@
 
     <ItemGroup>
         <PackageReference Include="ACMESharpCore" Version="2.2.0.148" />
+        <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
         <PackageReference Include="bblanchon.PDFium.Win32" Version="127.0.6504" />
         <PackageReference Include="Core.System.Configuration.Install" Version="1.1.0" />
         <PackageReference Include="Core.System.ServiceProcess" Version="2.0.1" />

+ 6 - 0
prs.stores/AssemblyInfo.cs

@@ -0,0 +1,6 @@
+using AutoProperties;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+[assembly: BypassAutoPropertySettersInConstructors(true)]

+ 2 - 1
prs.stores/FodyWeavers.xml

@@ -1,3 +1,4 @@
 <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
-  <PropertyChanged />
+	<AutoProperties/>
+	<PropertyChanged />
 </Weavers>

+ 1 - 0
prs.stores/FodyWeavers.xsd

@@ -53,6 +53,7 @@
             </xs:attribute>
           </xs:complexType>
         </xs:element>
+        <xs:element name="AutoProperties" minOccurs="0" maxOccurs="1" type="xs:anyType" />
       </xs:all>
       <xs:attribute name="VerifyAssembly" type="xs:boolean">
         <xs:annotation>

+ 1 - 0
prs.stores/PRSStores.csproj

@@ -9,6 +9,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <PackageReference Include="AutoProperties.Fody" Version="1.25.0" />
     <PackageReference Include="Fody" Version="6.8.1">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>