Browse Source

第一次提交

WXW 4 years ago
commit
6e11ed5189
100 changed files with 7835 additions and 0 deletions
  1. 17 0
      .gitignore
  2. 17 0
      EntityDataSet/App.Config
  3. 161 0
      EntityDataSet/EntityDataSet.csproj
  4. 46 0
      EntityDataSet/MySqlModel.Context.cs
  5. 735 0
      EntityDataSet/MySqlModel.Context.tt
  6. 4 0
      EntityDataSet/MySqlModel.Designer.cs
  7. 9 0
      EntityDataSet/MySqlModel.cs
  8. 1096 0
      EntityDataSet/MySqlModel.edmx
  9. 28 0
      EntityDataSet/MySqlModel.edmx.diagram
  10. 845 0
      EntityDataSet/MySqlModel.tt
  11. 36 0
      EntityDataSet/Properties/AssemblyInfo.cs
  12. 35 0
      EntityDataSet/control_info.cs
  13. 34 0
      EntityDataSet/control_log.cs
  14. 36 0
      EntityDataSet/electricaltestingpointai.cs
  15. 36 0
      EntityDataSet/electricaltestingpointdi.cs
  16. 22 0
      EntityDataSet/gycp_address.cs
  17. 23 0
      EntityDataSet/gycp_cmd_info.cs
  18. BIN
      EntityDataSet/lib/MySql.Data.Entity.EF6.dll
  19. 27 0
      EntityDataSet/line.cs
  20. 5 0
      EntityDataSet/packages.config
  21. 32 0
      EntityDataSet/project.cs
  22. 34 0
      EntityDataSet/user.cs
  23. 23 0
      EntityDataSet/view_tspoint.cs
  24. 23 0
      EntityDataSet/view_tspoint1.cs
  25. 37 0
      EntityDataSet/windpowerstation.cs
  26. 34 0
      EntityDataSet/windpowerstationtestingpoint.cs
  27. 32 0
      EntityDataSet/windturbine.cs
  28. 46 0
      EntityDataSet/windturbine_uniform_code.cs
  29. 36 0
      EntityDataSet/windturbinetestingpointai.cs
  30. 36 0
      EntityDataSet/windturbinetestingpointdi.cs
  31. 58 0
      GDNXFD.Alert.Config/App.config
  32. 30 0
      GDNXFD.Alert.Config/App.xaml
  33. 32 0
      GDNXFD.Alert.Config/App.xaml.cs
  34. 58 0
      GDNXFD.Alert.Config/App2.config
  35. 25 0
      GDNXFD.Alert.Config/Cache/GlobalVar.cs
  36. 36 0
      GDNXFD.Alert.Config/Controls/ComboBoxKeyboard.cs
  37. 44 0
      GDNXFD.Alert.Config/Controls/CustomDialog.xaml
  38. 25 0
      GDNXFD.Alert.Config/Controls/CustomDialog.xaml.cs
  39. 342 0
      GDNXFD.Alert.Config/Controls/LoadingControl.xaml
  40. 18 0
      GDNXFD.Alert.Config/Controls/LoadingControl.xaml.cs
  41. 99 0
      GDNXFD.Alert.Config/Controls/MultiSelectComboBox.xaml
  42. 286 0
      GDNXFD.Alert.Config/Controls/MultiSelectComboBox.xaml.cs
  43. 40 0
      GDNXFD.Alert.Config/Controls/TextBoxKeyboard.cs
  44. 30 0
      GDNXFD.Alert.Config/Converters/BooleanToEnabledDisabledConverter.cs
  45. 48 0
      GDNXFD.Alert.Config/Converters/BooleanToRadioButtonConverter.cs
  46. 47 0
      GDNXFD.Alert.Config/Converters/BooleanToVisibilityConverter.cs
  47. 48 0
      GDNXFD.Alert.Config/Converters/ByteToImageConverter.cs
  48. 51 0
      GDNXFD.Alert.Config/Converters/Category2ToTextConverter.cs
  49. 57 0
      GDNXFD.Alert.Config/Converters/CategoryCodeToTextConverter.cs
  50. 47 0
      GDNXFD.Alert.Config/Converters/EmployeeToVisibilityConverter.cs
  51. 59 0
      GDNXFD.Alert.Config/Converters/EnumToBooleanConverter.cs
  52. 47 0
      GDNXFD.Alert.Config/Converters/IdToVisibilityConverter.cs
  53. 57 0
      GDNXFD.Alert.Config/Converters/LevelIdToTextConverter.cs
  54. 57 0
      GDNXFD.Alert.Config/Converters/RankCodeToTextConverter.cs
  55. 65 0
      GDNXFD.Alert.Config/Converters/StationIdToTextConverter.cs
  56. 56 0
      GDNXFD.Alert.Config/Converters/TravelTypeToTextConverter.cs
  57. 359 0
      GDNXFD.Alert.Config/GDNXFD.Alert.Config.csproj
  58. 79 0
      GDNXFD.Alert.Config/Helpers/PasswordBoxHelper.cs
  59. 158 0
      GDNXFD.Alert.Config/Helpers/ShortcutHelper.cs
  60. 126 0
      GDNXFD.Alert.Config/Helpers/TabtipHelper.cs
  61. 12 0
      GDNXFD.Alert.Config/MainWindow.xaml
  62. 28 0
      GDNXFD.Alert.Config/MainWindow.xaml.cs
  63. 92 0
      GDNXFD.Alert.Config/Model/CustomDialogMessage.cs
  64. 34 0
      GDNXFD.Alert.Config/Model/LoadingMessage.cs
  65. 68 0
      GDNXFD.Alert.Config/Model/PageItem.cs
  66. 93 0
      GDNXFD.Alert.Config/Model/PaginationConfig.cs
  67. 34 0
      GDNXFD.Alert.Config/Model/UserLoginMessage.cs
  68. 15 0
      GDNXFD.Alert.Config/Model/enums/FormMode.cs
  69. 55 0
      GDNXFD.Alert.Config/Properties/AssemblyInfo.cs
  70. 71 0
      GDNXFD.Alert.Config/Properties/Resources.Designer.cs
  71. 117 0
      GDNXFD.Alert.Config/Properties/Resources.resx
  72. 30 0
      GDNXFD.Alert.Config/Properties/Settings.Designer.cs
  73. 7 0
      GDNXFD.Alert.Config/Properties/Settings.settings
  74. 70 0
      GDNXFD.Alert.Config/Properties/app.manifest
  75. 356 0
      GDNXFD.Alert.Config/Resources/Common/Buttons.xaml
  76. 35 0
      GDNXFD.Alert.Config/Resources/Common/Colors.xaml
  77. 15 0
      GDNXFD.Alert.Config/Resources/Common/CommonResources.xaml
  78. 107 0
      GDNXFD.Alert.Config/Resources/Common/InputElements.xaml
  79. 6 0
      GDNXFD.Alert.Config/Resources/Common/ItemsPanel.xaml
  80. 153 0
      GDNXFD.Alert.Config/Resources/Common/ItemsTemplates.xaml
  81. 46 0
      GDNXFD.Alert.Config/Resources/Common/RadioButtonStyles.xaml
  82. 218 0
      GDNXFD.Alert.Config/Resources/Common/Scroll.xaml
  83. 117 0
      GDNXFD.Alert.Config/Resources/Common/TextBlocks.xaml
  84. 27 0
      GDNXFD.Alert.Config/Resources/Common/TextBoxes.xaml
  85. BIN
      GDNXFD.Alert.Config/Resources/Images/Confirm.png
  86. BIN
      GDNXFD.Alert.Config/Resources/Images/_form.png
  87. BIN
      GDNXFD.Alert.Config/Resources/Images/_list.png
  88. BIN
      GDNXFD.Alert.Config/Resources/Images/attach.png
  89. BIN
      GDNXFD.Alert.Config/Resources/Images/back.png
  90. BIN
      GDNXFD.Alert.Config/Resources/Images/calendar.png
  91. BIN
      GDNXFD.Alert.Config/Resources/Images/cancel.png
  92. BIN
      GDNXFD.Alert.Config/Resources/Images/cancel2.png
  93. BIN
      GDNXFD.Alert.Config/Resources/Images/check-big.png
  94. BIN
      GDNXFD.Alert.Config/Resources/Images/delete.png
  95. BIN
      GDNXFD.Alert.Config/Resources/Images/edit.png
  96. BIN
      GDNXFD.Alert.Config/Resources/Images/favicon.ico
  97. BIN
      GDNXFD.Alert.Config/Resources/Images/favicon_old.ico
  98. BIN
      GDNXFD.Alert.Config/Resources/Images/file-delete-over.png
  99. BIN
      GDNXFD.Alert.Config/Resources/Images/file-delete.png
  100. 0 0
      GDNXFD.Alert.Config/Resources/Images/file-download-over.png

+ 17 - 0
.gitignore

@@ -0,0 +1,17 @@
+################################################################################
+# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
+################################################################################
+.vs/
+.vs/IntelligentControlForsx/v14/.suo
+*/out
+*/obj
+*/bin/Release/
+*/bin/Debug/
+Release/
+Debug/
+*.suo
+*.cache
+*.log
+*.pdb
+
+

+ 17 - 0
EntityDataSet/App.Config

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+  </configSections>
+  <connectionStrings>
+    <add name="wisdom_cs_entity" connectionString="metadata=res://*/MySqlModel.csdl|res://*/MySqlModel.ssdl|res://*/MySqlModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=127.0.0.1;user id=root;password=123;database=wisdom_cs&quot;" providerName="System.Data.EntityClient" />
+  </connectionStrings>
+  <entityFramework>
+    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
+      <parameters>
+        <parameter value="v11.0" />
+      </parameters>
+    </defaultConnectionFactory>
+  </entityFramework>
+</configuration>

+ 161 - 0
EntityDataSet/EntityDataSet.csproj

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1FB6FA96-6460-452A-9484-701E4F33FEBC}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>EntityDataSet</RootNamespace>
+    <AssemblyName>EntityDataSet</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="MySql.Data.Entity.EF6, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>lib\MySql.Data.Entity.EF6.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.Entity" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Security" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="control_info.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="control_log.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="electricaltestingpointai.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="electricaltestingpointdi.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="gycp_address.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="gycp_cmd_info.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="line.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="MySqlModel.Context.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>MySqlModel.Context.tt</DependentUpon>
+    </Compile>
+    <Compile Include="MySqlModel.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="MySqlModel.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>MySqlModel.edmx</DependentUpon>
+    </Compile>
+    <Compile Include="project.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="user.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="view_tspoint.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="view_tspoint1.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windpowerstation.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windpowerstationtestingpoint.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windturbine.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windturbinetestingpointai.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windturbinetestingpointdi.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="windturbine_uniform_code.cs">
+      <DependentUpon>MySqlModel.tt</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <EntityDeploy Include="MySqlModel.edmx">
+      <Generator>EntityModelCodeGenerator</Generator>
+      <LastGenOutput>MySqlModel.Designer.cs</LastGenOutput>
+    </EntityDeploy>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.Config">
+      <SubType>Designer</SubType>
+    </None>
+    <None Include="MySqlModel.Context.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>MySqlModel.edmx</DependentUpon>
+      <LastGenOutput>MySqlModel.Context.cs</LastGenOutput>
+    </None>
+    <None Include="MySqlModel.edmx.diagram">
+      <DependentUpon>MySqlModel.edmx</DependentUpon>
+    </None>
+    <None Include="MySqlModel.tt">
+      <Generator>TextTemplatingFileGenerator</Generator>
+      <DependentUpon>MySqlModel.edmx</DependentUpon>
+      <LastGenOutput>MySqlModel.cs</LastGenOutput>
+    </None>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="lib\MySql.Data.Entity.EF6.dll" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 46 - 0
EntityDataSet/MySqlModel.Context.cs

@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Data.Entity;
+    using System.Data.Entity.Infrastructure;
+    
+    public partial class wisdom_cs_entity : DbContext
+    {
+        public wisdom_cs_entity()
+            : base("name=wisdom_cs_entity")
+        {
+        }
+    
+        protected override void OnModelCreating(DbModelBuilder modelBuilder)
+        {
+            throw new UnintentionalCodeFirstException();
+        }
+    
+        public DbSet<line> line { get; set; }
+        public DbSet<project> project { get; set; }
+        public DbSet<windpowerstation> windpowerstation { get; set; }
+        public DbSet<electricaltestingpointai> electricaltestingpointai { get; set; }
+        public DbSet<electricaltestingpointdi> electricaltestingpointdi { get; set; }
+        public DbSet<windpowerstationtestingpoint> windpowerstationtestingpoint { get; set; }
+        public DbSet<windturbinetestingpointai> windturbinetestingpointai { get; set; }
+        public DbSet<windturbinetestingpointdi> windturbinetestingpointdi { get; set; }
+        public DbSet<view_tspoint> view_tspoint { get; set; }
+        public DbSet<view_tspoint1> view_tspoint1 { get; set; }
+        public DbSet<control_info> control_info { get; set; }
+        public DbSet<gycp_cmd_info> gycp_cmd_info { get; set; }
+        public DbSet<windturbine> windturbine { get; set; }
+        public DbSet<user> user { get; set; }
+        public DbSet<gycp_address> gycp_address { get; set; }
+        public DbSet<control_log> control_log { get; set; }
+        public DbSet<windturbine_uniform_code> windturbine_uniform_code { get; set; }
+    }
+}

+ 735 - 0
EntityDataSet/MySqlModel.Context.tt

@@ -0,0 +1,735 @@
+<#@ template language="C#" debug="false" hostspecific="true"#>
+<#@ include file="EF.Utility.CS.ttinclude"#><#@
+ output extension=".cs"#><#
+
+const string inputFile = @"MySqlModel.edmx";
+var textTransform = DynamicTextTransformation.Create(this);
+var code = new CodeGenerationTools(this);
+var ef = new MetadataTools(this);
+var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
+var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
+var itemCollection = loader.CreateEdmItemCollection(inputFile);
+var modelNamespace = loader.GetModelNamespace(inputFile);
+var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
+
+var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
+if (container == null)
+{
+    return string.Empty;
+}
+#>
+//------------------------------------------------------------------------------
+// <auto-generated>
+// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#>
+//
+// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#>
+// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#>
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+<#
+
+var codeNamespace = code.VsNamespaceSuggestion();
+if (!String.IsNullOrEmpty(codeNamespace))
+{
+#>
+namespace <#=code.EscapeNamespace(codeNamespace)#>
+{
+<#
+    PushIndent("    ");
+}
+
+#>
+using System;
+using System.Data.Entity;
+using System.Data.Entity.Infrastructure;
+<#
+if (container.FunctionImports.Any())
+{
+#>
+using System.Data.Objects;
+using System.Data.Objects.DataClasses;
+using System.Linq;
+<#
+}
+#>
+
+<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
+{
+    public <#=code.Escape(container)#>()
+        : base("name=<#=container.Name#>")
+    {
+<#
+if (!loader.IsLazyLoadingEnabled(container))
+{
+#>
+        this.Configuration.LazyLoadingEnabled = false;
+<#
+}
+#>
+    }
+
+    protected override void OnModelCreating(DbModelBuilder modelBuilder)
+    {
+        throw new UnintentionalCodeFirstException();
+    }
+
+<#
+    foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
+    {
+#>
+    <#=codeStringGenerator.DbSet(entitySet)#>
+<#
+    }
+
+    foreach (var edmFunction in container.FunctionImports)
+    {
+        WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
+    }
+#>
+}
+<#
+
+if (!String.IsNullOrEmpty(codeNamespace))
+{
+    PopIndent();
+#>
+}
+<#
+}
+#>
+<#+
+
+private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+{
+    if (typeMapper.IsComposable(edmFunction))
+    {
+#>
+
+    [EdmFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
+    <#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
+    {
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
+#>
+        <#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
+    }
+<#+
+    }
+    else
+    {
+#>
+
+    <#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
+    {
+<#+
+        codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
+#>
+        <#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
+    }
+<#+
+        if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
+        {
+            WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
+        }
+    }
+}
+
+public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
+{
+#>
+        var <#=name#> = <#=isNotNull#> ?
+            <#=notNullInit#> :
+            <#=nullInit#>;
+
+<#+
+}
+
+public const string TemplateId = "CSharp_DbContext_Context_EF5";
+
+public class CodeStringGenerator
+{
+    private readonly CodeGenerationTools _code;
+    private readonly TypeMapper _typeMapper;
+    private readonly MetadataTools _ef;
+
+    public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(typeMapper, "typeMapper");
+        ArgumentNotNull(ef, "ef");
+
+        _code = code;
+        _typeMapper = typeMapper;
+        _ef = ef;
+    }
+
+    public string Property(EdmProperty edmProperty)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            Accessibility.ForProperty(edmProperty),
+            _typeMapper.GetTypeName(edmProperty.TypeUsage),
+            _code.Escape(edmProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
+    }
+
+    public string NavigationProperty(NavigationProperty navigationProperty)
+    {
+        var endType = _typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType());
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            AccessibilityAndVirtual(Accessibility.ForProperty(navigationProperty)),
+            navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
+            _code.Escape(navigationProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(navigationProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(navigationProperty)));
+    }
+    
+    public string AccessibilityAndVirtual(string accessibility)
+    {
+        return accessibility + (accessibility != "private" ? " virtual" : "");
+    }
+    
+    public string EntityClassOpening(EntityType entity)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1}partial class {2}{3}",
+            Accessibility.ForType(entity),
+            _code.SpaceAfter(_code.AbstractOption(entity)),
+            _code.Escape(entity),
+            _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
+    }
+    
+    public string EnumOpening(SimpleType enumType)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} enum {1} : {2}",
+            Accessibility.ForType(enumType),
+            _code.Escape(enumType),
+            _code.Escape(_typeMapper.UnderlyingClrType(enumType)));
+        }
+    
+    public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
+    {
+        var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+        foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
+        {
+            var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
+            var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
+            var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))";
+            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
+        }
+    }
+    
+    public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} IQueryable<{1}> {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            _code.Escape(edmFunction),
+            string.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()));
+    }
+    
+    public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            edmFunction.NamespaceName,
+            edmFunction.Name,
+            string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
+            _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
+    }
+    
+    public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray());
+        if (includeMergeOption)
+        {
+            paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
+        }
+
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            _code.Escape(edmFunction),
+            paramList);
+    }
+    
+    public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
+        if (includeMergeOption)
+        {
+            callParams = ", mergeOption" + callParams;
+        }
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
+            returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            edmFunction.Name,
+            callParams);
+    }
+    
+    public string DbSet(EntitySet entitySet)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} DbSet<{1}> {2} {{ get; set; }}",
+            Accessibility.ForReadOnlyProperty(entitySet),
+            _typeMapper.GetTypeName(entitySet.ElementType),
+            _code.Escape(entitySet));
+    }
+
+    public string UsingDirectives(bool inHeader, bool includeCollections = true)
+    {
+        return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
+            ? string.Format(
+                CultureInfo.InvariantCulture,
+                "{0}using System;{1}" +
+                "{2}",
+                inHeader ? Environment.NewLine : "",
+                includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
+                inHeader ? "" : Environment.NewLine)
+            : "";
+    }
+}
+
+public class TypeMapper
+{
+    private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
+
+    private readonly System.Collections.IList _errors;
+    private readonly CodeGenerationTools _code;
+    private readonly MetadataTools _ef;
+
+    public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(ef, "ef");
+        ArgumentNotNull(errors, "errors");
+
+        _code = code;
+        _ef = ef;
+        _errors = errors;
+    }
+
+    public string GetTypeName(TypeUsage typeUsage)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
+    }
+
+    public string GetTypeName(EdmType edmType)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: null);
+    }
+
+    public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, string modelNamespace)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
+    {
+        if (edmType == null)
+        {
+            return null;
+        }
+
+        var collectionType = edmType as CollectionType;
+        if (collectionType != null)
+        {
+            return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
+        }
+
+        var typeName = _code.Escape(edmType.MetadataProperties
+                                .Where(p => p.Name == ExternalTypeNameAttributeName)
+                                .Select(p => (string)p.Value)
+                                .FirstOrDefault())
+            ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
+                _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
+                _code.Escape(edmType));
+
+        if (edmType is StructuralType)
+        {
+            return typeName;
+        }
+
+        if (edmType is SimpleType)
+        {
+            var clrType = UnderlyingClrType(edmType);
+            if (!IsEnumType(edmType))
+            {
+                typeName = _code.Escape(clrType);
+            }
+
+            return clrType.IsValueType && isNullable == true ?
+                String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
+                typeName;
+        }
+
+        throw new ArgumentException("edmType");
+    }
+    
+    public Type UnderlyingClrType(EdmType edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        var primitiveType = edmType as PrimitiveType;
+        if (primitiveType != null)
+        {
+            return primitiveType.ClrEquivalentType;
+        }
+
+        if (IsEnumType(edmType))
+        {
+            return GetEnumUnderlyingType(edmType).ClrEquivalentType;
+        }
+
+        return typeof(object);
+    }
+    
+    public object GetEnumMemberValue(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var valueProperty = enumMember.GetType().GetProperty("Value");
+        return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
+    }
+    
+    public string GetEnumMemberName(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var nameProperty = enumMember.GetType().GetProperty("Name");
+        return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
+    }
+
+    public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        var membersProperty = enumType.GetType().GetProperty("Members");
+        return membersProperty != null 
+            ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
+            : Enumerable.Empty<MetadataItem>();
+    }
+    
+    public bool EnumIsFlags(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+        
+        var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
+        return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
+    }
+
+    public bool IsEnumType(GlobalItem edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        return edmType.GetType().Name == "EnumType";
+    }
+
+    public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
+    }
+
+    public string CreateLiteral(object value)
+    {
+        if (value == null || value.GetType() != typeof(TimeSpan))
+        {
+            return _code.CreateLiteral(value);
+        }
+
+        return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
+    }
+    
+    public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
+    {
+        ArgumentNotNull(types, "types");
+        ArgumentNotNull(sourceFile, "sourceFile");
+        
+        var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
+        if (types.Any(item => !hash.Add(item)))
+        {
+            _errors.Add(
+                new CompilerError(sourceFile, -1, -1, "6023",
+                    String.Format(CultureInfo.CurrentCulture, GetResourceString("Template_CaseInsensitiveTypeConflict"))));
+            return false;
+        }
+        return true;
+    }
+    
+    public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
+    {
+        return GetItemsToGenerate<SimpleType>(itemCollection)
+            .Where(e => IsEnumType(e));
+    }
+    
+    public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
+    {
+        return itemCollection
+            .OfType<T>()
+            .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
+            .OrderBy(i => i.Name);
+    }
+
+    public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
+    {
+        return itemCollection
+            .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
+            .Select(g => GetGlobalItemName(g));
+    }
+
+    public string GetGlobalItemName(GlobalItem item)
+    {
+        if (item is EdmType)
+        {
+            return ((EdmType)item).Name;
+        }
+        else
+        {
+            return ((EntityContainer)item).Name;
+        }
+    }
+
+    public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+    
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+
+    public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type);
+    }
+    
+    public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
+    }
+    
+    public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
+        return returnParamsProperty == null
+            ? edmFunction.ReturnParameter
+            : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
+    }
+
+    public bool IsComposable(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
+        return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
+    }
+
+    public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
+    {
+        return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+    }
+
+    public TypeUsage GetReturnType(EdmFunction edmFunction)
+    {
+        var returnParam = GetReturnParameter(edmFunction);
+        return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
+    }
+    
+    public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
+    {
+        var returnType = GetReturnType(edmFunction);
+        return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
+    }
+}
+
+public class EdmMetadataLoader
+{
+    private readonly IDynamicHost _host;
+    private readonly System.Collections.IList _errors;
+
+    public EdmMetadataLoader(IDynamicHost host, System.Collections.IList errors)
+    {
+        ArgumentNotNull(host, "host");
+        ArgumentNotNull(errors, "errors");
+
+        _host = host;
+        _errors = errors;
+    }
+
+    public IEnumerable<GlobalItem> CreateEdmItemCollection(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        if (!ValidateInputPath(sourcePath))
+        {
+            return new EdmItemCollection();
+        }
+
+        var schemaElement = LoadRootElement(_host.ResolvePath(sourcePath));
+        if (schemaElement != null)
+        {
+            using (var reader = schemaElement.CreateReader())
+            {
+                IList<EdmSchemaError> errors;
+                var itemCollection = MetadataItemCollectionFactory.CreateEdmItemCollection(new[] { reader }, out errors);
+
+                ProcessErrors(errors, sourcePath);
+
+                return itemCollection;
+            }
+        }
+        return new EdmItemCollection();
+    }
+
+    public string GetModelNamespace(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        if (!ValidateInputPath(sourcePath))
+        {
+            return string.Empty;
+        }
+
+        var model = LoadRootElement(_host.ResolvePath(sourcePath));
+        if (model == null)
+        {
+            return string.Empty;
+        }
+
+        var attribute = model.Attribute("Namespace");
+        return attribute != null ? attribute.Value : "";
+    }
+
+    private bool ValidateInputPath(string sourcePath)
+    {
+        if (sourcePath == "$" + "edmxInputFile" + "$")
+        {
+            _errors.Add(
+                new CompilerError(_host.TemplateFile ?? sourcePath, 0, 0, string.Empty,
+                    GetResourceString("Template_ReplaceVsItemTemplateToken")));
+            return false;
+        }
+
+        return true;
+    }
+
+    public XElement LoadRootElement(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        var root = XElement.Load(sourcePath, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo);
+        return root.Elements()
+            .Where(e => e.Name.LocalName == "Runtime")
+            .Elements()
+            .Where(e => e.Name.LocalName == "ConceptualModels")
+            .Elements()
+            .Where(e => e.Name.LocalName == "Schema")
+            .FirstOrDefault()
+                ?? root;
+    }
+
+    private void ProcessErrors(IEnumerable<EdmSchemaError> errors, string sourceFilePath)
+    {
+        foreach (var error in errors)
+        {
+            _errors.Add(
+                new CompilerError(
+                    error.SchemaLocation ?? sourceFilePath,
+                    error.Line,
+                    error.Column,
+                    error.ErrorCode.ToString(CultureInfo.InvariantCulture),
+                    error.Message)
+                {
+                    IsWarning = error.Severity == EdmSchemaErrorSeverity.Warning
+                });
+        }
+    }
+    
+    public bool IsLazyLoadingEnabled(EntityContainer container)
+    {
+        string lazyLoadingAttributeValue;
+        var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled";
+        bool isLazyLoading;
+        return !MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)
+            || !bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading)
+            || isLazyLoading;
+    }
+}
+
+public static void ArgumentNotNull<T>(T arg, string name) where T : class
+{
+    if (arg == null)
+    {
+        throw new ArgumentNullException(name);
+    }
+}
+    
+private static readonly Lazy<System.Resources.ResourceManager> ResourceManager =
+    new Lazy<System.Resources.ResourceManager>(
+        () => new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(MetadataItemCollectionFactory).Assembly), isThreadSafe: true);
+
+public static string GetResourceString(string resourceName)
+{
+    ArgumentNotNull(resourceName, "resourceName");
+
+    return ResourceManager.Value.GetString(resourceName, null);
+}
+
+#>

+ 4 - 0
EntityDataSet/MySqlModel.Designer.cs

@@ -0,0 +1,4 @@
+// 模型“D:\Gyee_project\ZHQT_Control\src\XnyWindTurbineContorls\EntityDataSet\MySqlModel.edmx”的默认代码生成功能已禁用。
+// 要启用默认代码生成功能,请将“代码生成策略”设计器属性的值
+// 更改为另一值。当在设计器中打开该模型时,此属性会出现在
+// “属性”窗口中。

+ 9 - 0
EntityDataSet/MySqlModel.cs

@@ -0,0 +1,9 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+

File diff suppressed because it is too large
+ 1096 - 0
EntityDataSet/MySqlModel.edmx


+ 28 - 0
EntityDataSet/MySqlModel.edmx.diagram

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
+ <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
+  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
+    <!-- Diagram content (shape and connector positions) -->
+    <edmx:Diagrams>
+      <Diagram DiagramId="aee80ee2b05f4e97a65669a3e4ddfc92" Name="关系图1" ZoomLevel="92">
+        <EntityTypeShape EntityType="wisdom_cs_model.line" Width="1.5" PointX="4.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="wisdom_cs_model.project" Width="1.5" PointX="4.75" PointY="4.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windpowerstation" Width="2.625" PointX="6.75" PointY="0.75" IsExpanded="true" />
+        <EntityTypeShape EntityType="wisdom_cs_model.electricaltestingpointai" Width="1.5" PointX="1.75" PointY="7.125" />
+        <EntityTypeShape EntityType="wisdom_cs_model.electricaltestingpointdi" Width="1.5" PointX="4.75" PointY="8.625" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windpowerstationtestingpoint" Width="2.625" PointX="7.875" PointY="10.875" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windturbinetestingpointai" Width="2.625" PointX="10.75" PointY="11.625" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windturbinetestingpointdi" Width="3.125" PointX="13.75" PointY="13.125" />
+        <EntityTypeShape EntityType="wisdom_cs_model.view_tspoint" Width="1.5" PointX="6.0942861484802719" PointY="14.745272986006585" />
+        <EntityTypeShape EntityType="wisdom_cs_model.view_tspoint1" Width="1.5" PointX="3" PointY="11.625" />
+        <EntityTypeShape EntityType="wisdom_cs_model.control_info" Width="1.5" PointX="2.25" PointY="19" />
+        <EntityTypeShape EntityType="wisdom_cs_model.gycp_cmd_info" Width="1.5" PointX="2.375" PointY="1.125" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windturbine" Width="1.5" PointX="5.5" PointY="22.875" />
+        <EntityTypeShape EntityType="wisdom_cs_model.user" Width="1.5" PointX="8.125" PointY="23" />
+        <EntityTypeShape EntityType="wisdom_cs_model.gycp_address" Width="1.5" PointX="7.625" PointY="20.875" />
+        <EntityTypeShape EntityType="wisdom_cs_model.control_log" Width="1.5" PointX="10.75" PointY="26" />
+        <EntityTypeShape EntityType="wisdom_cs_model.windturbine_uniform_code" Width="1.5" PointX="1.5380213360944863" PointY="24.053237523908372" />
+      </Diagram>
+    </edmx:Diagrams>
+  </edmx:Designer>
+</edmx:Edmx>

+ 845 - 0
EntityDataSet/MySqlModel.tt

@@ -0,0 +1,845 @@
+<#@ template language="C#" debug="false" hostspecific="true"#>
+<#@ include file="EF.Utility.CS.ttinclude"#><#@ 
+ output extension=".cs"#><#
+
+const string inputFile = @"MySqlModel.edmx";
+var textTransform = DynamicTextTransformation.Create(this);
+var code = new CodeGenerationTools(this);
+var ef = new MetadataTools(this);
+var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
+var	fileManager = EntityFrameworkTemplateFileManager.Create(this);
+var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile);
+var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
+
+if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile))
+{
+    return string.Empty;
+}
+
+WriteHeader(codeStringGenerator, fileManager);
+
+foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
+{
+    fileManager.StartNewFile(entity.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false)#>
+<#=codeStringGenerator.EntityClassOpening(entity)#>
+{
+<#
+    var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity);
+    var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity);
+    var complexProperties = typeMapper.GetComplexProperties(entity);
+
+    if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any())
+    {
+#>
+    public <#=code.Escape(entity)#>()
+    {
+<#
+        foreach (var edmProperty in propertiesWithDefaultValues)
+        {
+#>
+        this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
+<#
+        }
+
+        foreach (var navigationProperty in collectionNavigationProperties)
+        {
+#>
+        this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>();
+<#
+        }
+
+        foreach (var complexProperty in complexProperties)
+        {
+#>
+        this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
+<#
+        }
+#>
+    }
+
+<#
+    }
+
+    var simpleProperties = typeMapper.GetSimpleProperties(entity);
+    if (simpleProperties.Any())
+    {
+        foreach (var edmProperty in simpleProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+
+    if (complexProperties.Any())
+    {
+#>
+
+<#
+        foreach(var complexProperty in complexProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(complexProperty)#>
+<#
+        }
+    }
+
+    var navigationProperties = typeMapper.GetNavigationProperties(entity);
+    if (navigationProperties.Any())
+    {
+#>
+
+<#
+        foreach (var navigationProperty in navigationProperties)
+        {
+#>
+    <#=codeStringGenerator.NavigationProperty(navigationProperty)#>
+<#
+        }
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection))
+{
+    fileManager.StartNewFile(complex.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
+<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#>
+{
+<#
+    var complexProperties = typeMapper.GetComplexProperties(complex);
+    var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex);
+
+    if (propertiesWithDefaultValues.Any() || complexProperties.Any())
+    {
+#>
+    public <#=code.Escape(complex)#>()
+    {
+<#
+        foreach (var edmProperty in propertiesWithDefaultValues)
+        {
+#>
+        this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
+<#
+        }
+
+        foreach (var complexProperty in complexProperties)
+        {
+#>
+        this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
+<#
+        }
+#>
+    }
+
+<#
+    }
+
+    var simpleProperties = typeMapper.GetSimpleProperties(complex);
+    if (simpleProperties.Any())
+    {
+        foreach(var edmProperty in simpleProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+
+    if (complexProperties.Any())
+    {
+#>
+
+<#
+        foreach(var edmProperty in complexProperties)
+        {
+#>
+    <#=codeStringGenerator.Property(edmProperty)#>
+<#
+        }
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection))
+{
+    fileManager.StartNewFile(enumType.Name + ".cs");
+    BeginNamespace(code);
+#>
+<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
+<#
+    if (typeMapper.EnumIsFlags(enumType))
+    {
+#>
+[Flags]
+<#
+    }
+#>
+<#=codeStringGenerator.EnumOpening(enumType)#>
+{
+<#
+    var foundOne = false;
+    
+    foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType))
+    {
+        foundOne = true;
+#>
+    <#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>,
+<#
+    }
+
+    if (foundOne)
+    {
+        this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1);
+    }
+#>
+}
+<#
+    EndNamespace(code);
+}
+
+fileManager.Process();
+
+#>
+<#+
+
+public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager)
+{
+    fileManager.StartHeader();
+#>
+//------------------------------------------------------------------------------
+// <auto-generated>
+// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#>
+//
+// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#>
+// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#>
+// </auto-generated>
+//------------------------------------------------------------------------------
+<#=codeStringGenerator.UsingDirectives(inHeader: true)#>
+<#+
+    fileManager.EndBlock();
+}
+
+public void BeginNamespace(CodeGenerationTools code)
+{
+    var codeNamespace = code.VsNamespaceSuggestion();
+    if (!String.IsNullOrEmpty(codeNamespace))
+    {
+#>
+namespace <#=code.EscapeNamespace(codeNamespace)#>
+{
+<#+
+        PushIndent("    ");
+    }
+}
+
+public void EndNamespace(CodeGenerationTools code)
+{
+    if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion()))
+    {
+        PopIndent();
+#>
+}
+<#+
+    }
+}
+
+public const string TemplateId = "CSharp_DbContext_Types_EF5";
+
+public class CodeStringGenerator
+{
+    private readonly CodeGenerationTools _code;
+    private readonly TypeMapper _typeMapper;
+    private readonly MetadataTools _ef;
+
+    public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(typeMapper, "typeMapper");
+        ArgumentNotNull(ef, "ef");
+
+        _code = code;
+        _typeMapper = typeMapper;
+        _ef = ef;
+    }
+
+    public string Property(EdmProperty edmProperty)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            Accessibility.ForProperty(edmProperty),
+            _typeMapper.GetTypeName(edmProperty.TypeUsage),
+            _code.Escape(edmProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
+    }
+
+    public string NavigationProperty(NavigationProperty navigationProperty)
+    {
+        var endType = _typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType());
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2} {{ {3}get; {4}set; }}",
+            AccessibilityAndVirtual(Accessibility.ForProperty(navigationProperty)),
+            navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
+            _code.Escape(navigationProperty),
+            _code.SpaceAfter(Accessibility.ForGetter(navigationProperty)),
+            _code.SpaceAfter(Accessibility.ForSetter(navigationProperty)));
+    }
+    
+    public string AccessibilityAndVirtual(string accessibility)
+    {
+        return accessibility + (accessibility != "private" ? " virtual" : "");
+    }
+    
+    public string EntityClassOpening(EntityType entity)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1}partial class {2}{3}",
+            Accessibility.ForType(entity),
+            _code.SpaceAfter(_code.AbstractOption(entity)),
+            _code.Escape(entity),
+            _code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
+    }
+    
+    public string EnumOpening(SimpleType enumType)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} enum {1} : {2}",
+            Accessibility.ForType(enumType),
+            _code.Escape(enumType),
+            _code.Escape(_typeMapper.UnderlyingClrType(enumType)));
+        }
+    
+    public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
+    {
+        var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+        foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
+        {
+            var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
+            var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
+            var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))";
+            writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
+        }
+    }
+    
+    public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} IQueryable<{1}> {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            _code.Escape(edmFunction),
+            string.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()));
+    }
+    
+    public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
+            _typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
+            edmFunction.NamespaceName,
+            edmFunction.Name,
+            string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
+            _code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
+    }
+    
+    public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray());
+        if (includeMergeOption)
+        {
+            paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
+        }
+
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} {1} {2}({3})",
+            AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
+            returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            _code.Escape(edmFunction),
+            paramList);
+    }
+    
+    public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
+    {
+        var parameters = _typeMapper.GetParameters(edmFunction);
+        var returnType = _typeMapper.GetReturnType(edmFunction);
+
+        var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
+        if (includeMergeOption)
+        {
+            callParams = ", mergeOption" + callParams;
+        }
+        
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
+            returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
+            edmFunction.Name,
+            callParams);
+    }
+    
+    public string DbSet(EntitySet entitySet)
+    {
+        return string.Format(
+            CultureInfo.InvariantCulture,
+            "{0} DbSet<{1}> {2} {{ get; set; }}",
+            Accessibility.ForReadOnlyProperty(entitySet),
+            _typeMapper.GetTypeName(entitySet.ElementType),
+            _code.Escape(entitySet));
+    }
+
+    public string UsingDirectives(bool inHeader, bool includeCollections = true)
+    {
+        return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
+            ? string.Format(
+                CultureInfo.InvariantCulture,
+                "{0}using System;{1}" +
+                "{2}",
+                inHeader ? Environment.NewLine : "",
+                includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
+                inHeader ? "" : Environment.NewLine)
+            : "";
+    }
+}
+
+public class TypeMapper
+{
+    private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
+
+    private readonly System.Collections.IList _errors;
+    private readonly CodeGenerationTools _code;
+    private readonly MetadataTools _ef;
+
+    public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
+    {
+        ArgumentNotNull(code, "code");
+        ArgumentNotNull(ef, "ef");
+        ArgumentNotNull(errors, "errors");
+
+        _code = code;
+        _ef = ef;
+        _errors = errors;
+    }
+
+    public string GetTypeName(TypeUsage typeUsage)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
+    }
+
+    public string GetTypeName(EdmType edmType)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: null);
+    }
+
+    public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
+    {
+        return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, string modelNamespace)
+    {
+        return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
+    }
+
+    public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
+    {
+        if (edmType == null)
+        {
+            return null;
+        }
+
+        var collectionType = edmType as CollectionType;
+        if (collectionType != null)
+        {
+            return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
+        }
+
+        var typeName = _code.Escape(edmType.MetadataProperties
+                                .Where(p => p.Name == ExternalTypeNameAttributeName)
+                                .Select(p => (string)p.Value)
+                                .FirstOrDefault())
+            ?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
+                _code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
+                _code.Escape(edmType));
+
+        if (edmType is StructuralType)
+        {
+            return typeName;
+        }
+
+        if (edmType is SimpleType)
+        {
+            var clrType = UnderlyingClrType(edmType);
+            if (!IsEnumType(edmType))
+            {
+                typeName = _code.Escape(clrType);
+            }
+
+            return clrType.IsValueType && isNullable == true ?
+                String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
+                typeName;
+        }
+
+        throw new ArgumentException("edmType");
+    }
+    
+    public Type UnderlyingClrType(EdmType edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        var primitiveType = edmType as PrimitiveType;
+        if (primitiveType != null)
+        {
+            return primitiveType.ClrEquivalentType;
+        }
+
+        if (IsEnumType(edmType))
+        {
+            return GetEnumUnderlyingType(edmType).ClrEquivalentType;
+        }
+
+        return typeof(object);
+    }
+    
+    public object GetEnumMemberValue(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var valueProperty = enumMember.GetType().GetProperty("Value");
+        return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
+    }
+    
+    public string GetEnumMemberName(MetadataItem enumMember)
+    {
+        ArgumentNotNull(enumMember, "enumMember");
+        
+        var nameProperty = enumMember.GetType().GetProperty("Name");
+        return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
+    }
+
+    public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        var membersProperty = enumType.GetType().GetProperty("Members");
+        return membersProperty != null 
+            ? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
+            : Enumerable.Empty<MetadataItem>();
+    }
+    
+    public bool EnumIsFlags(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+        
+        var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
+        return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
+    }
+
+    public bool IsEnumType(GlobalItem edmType)
+    {
+        ArgumentNotNull(edmType, "edmType");
+
+        return edmType.GetType().Name == "EnumType";
+    }
+
+    public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
+    {
+        ArgumentNotNull(enumType, "enumType");
+
+        return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
+    }
+
+    public string CreateLiteral(object value)
+    {
+        if (value == null || value.GetType() != typeof(TimeSpan))
+        {
+            return _code.CreateLiteral(value);
+        }
+
+        return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
+    }
+    
+    public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
+    {
+        ArgumentNotNull(types, "types");
+        ArgumentNotNull(sourceFile, "sourceFile");
+        
+        var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
+        if (types.Any(item => !hash.Add(item)))
+        {
+            _errors.Add(
+                new CompilerError(sourceFile, -1, -1, "6023",
+                    String.Format(CultureInfo.CurrentCulture, GetResourceString("Template_CaseInsensitiveTypeConflict"))));
+            return false;
+        }
+        return true;
+    }
+    
+    public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
+    {
+        return GetItemsToGenerate<SimpleType>(itemCollection)
+            .Where(e => IsEnumType(e));
+    }
+    
+    public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
+    {
+        return itemCollection
+            .OfType<T>()
+            .Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
+            .OrderBy(i => i.Name);
+    }
+
+    public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
+    {
+        return itemCollection
+            .Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
+            .Select(g => GetGlobalItemName(g));
+    }
+
+    public string GetGlobalItemName(GlobalItem item)
+    {
+        if (item is EdmType)
+        {
+            return ((EdmType)item).Name;
+        }
+        else
+        {
+            return ((EntityContainer)item).Name;
+        }
+    }
+
+    public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+    
+    public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
+    }
+
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+    
+    public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
+    {
+        return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
+    }
+
+    public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type);
+    }
+    
+    public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
+    {
+        return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
+    }
+    
+    public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
+        return returnParamsProperty == null
+            ? edmFunction.ReturnParameter
+            : ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
+    }
+
+    public bool IsComposable(EdmFunction edmFunction)
+    {
+        ArgumentNotNull(edmFunction, "edmFunction");
+
+        var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
+        return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
+    }
+
+    public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
+    {
+        return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
+    }
+
+    public TypeUsage GetReturnType(EdmFunction edmFunction)
+    {
+        var returnParam = GetReturnParameter(edmFunction);
+        return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
+    }
+    
+    public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
+    {
+        var returnType = GetReturnType(edmFunction);
+        return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
+    }
+}
+
+public class EdmMetadataLoader
+{
+    private readonly IDynamicHost _host;
+    private readonly System.Collections.IList _errors;
+
+    public EdmMetadataLoader(IDynamicHost host, System.Collections.IList errors)
+    {
+        ArgumentNotNull(host, "host");
+        ArgumentNotNull(errors, "errors");
+
+        _host = host;
+        _errors = errors;
+    }
+
+    public IEnumerable<GlobalItem> CreateEdmItemCollection(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        if (!ValidateInputPath(sourcePath))
+        {
+            return new EdmItemCollection();
+        }
+
+        var schemaElement = LoadRootElement(_host.ResolvePath(sourcePath));
+        if (schemaElement != null)
+        {
+            using (var reader = schemaElement.CreateReader())
+            {
+                IList<EdmSchemaError> errors;
+                var itemCollection = MetadataItemCollectionFactory.CreateEdmItemCollection(new[] { reader }, out errors);
+
+                ProcessErrors(errors, sourcePath);
+
+                return itemCollection;
+            }
+        }
+        return new EdmItemCollection();
+    }
+
+    public string GetModelNamespace(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        if (!ValidateInputPath(sourcePath))
+        {
+            return string.Empty;
+        }
+
+        var model = LoadRootElement(_host.ResolvePath(sourcePath));
+        if (model == null)
+        {
+            return string.Empty;
+        }
+
+        var attribute = model.Attribute("Namespace");
+        return attribute != null ? attribute.Value : "";
+    }
+
+    private bool ValidateInputPath(string sourcePath)
+    {
+        if (sourcePath == "$" + "edmxInputFile" + "$")
+        {
+            _errors.Add(
+                new CompilerError(_host.TemplateFile ?? sourcePath, 0, 0, string.Empty,
+                    GetResourceString("Template_ReplaceVsItemTemplateToken")));
+            return false;
+        }
+
+        return true;
+    }
+
+    public XElement LoadRootElement(string sourcePath)
+    {
+        ArgumentNotNull(sourcePath, "sourcePath");
+
+        var root = XElement.Load(sourcePath, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo);
+        return root.Elements()
+            .Where(e => e.Name.LocalName == "Runtime")
+            .Elements()
+            .Where(e => e.Name.LocalName == "ConceptualModels")
+            .Elements()
+            .Where(e => e.Name.LocalName == "Schema")
+            .FirstOrDefault()
+                ?? root;
+    }
+
+    private void ProcessErrors(IEnumerable<EdmSchemaError> errors, string sourceFilePath)
+    {
+        foreach (var error in errors)
+        {
+            _errors.Add(
+                new CompilerError(
+                    error.SchemaLocation ?? sourceFilePath,
+                    error.Line,
+                    error.Column,
+                    error.ErrorCode.ToString(CultureInfo.InvariantCulture),
+                    error.Message)
+                {
+                    IsWarning = error.Severity == EdmSchemaErrorSeverity.Warning
+                });
+        }
+    }
+    
+    public bool IsLazyLoadingEnabled(EntityContainer container)
+    {
+        string lazyLoadingAttributeValue;
+        var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled";
+        bool isLazyLoading;
+        return !MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)
+            || !bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading)
+            || isLazyLoading;
+    }
+}
+
+public static void ArgumentNotNull<T>(T arg, string name) where T : class
+{
+    if (arg == null)
+    {
+        throw new ArgumentNullException(name);
+    }
+}
+    
+private static readonly Lazy<System.Resources.ResourceManager> ResourceManager =
+    new Lazy<System.Resources.ResourceManager>(
+        () => new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(MetadataItemCollectionFactory).Assembly), isThreadSafe: true);
+
+public static string GetResourceString(string resourceName)
+{
+    ArgumentNotNull(resourceName, "resourceName");
+
+    return ResourceManager.Value.GetString(resourceName, null);
+}
+
+#>

+ 36 - 0
EntityDataSet/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("EntityDataSet")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EntityDataSet")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("b9dbe1c6-7684-4b52-a6a9-6ab274ec649a")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+//      主版本
+//      次版本 
+//      生成号
+//      修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 35 - 0
EntityDataSet/control_info.cs

@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class control_info
+    {
+        public int id { get; set; }
+        public Nullable<int> type { get; set; }
+        public Nullable<System.DateTime> time { get; set; }
+        public Nullable<System.DateTime> success_time { get; set; }
+        public Nullable<int> user_id { get; set; }
+        public string windturbine_id { get; set; }
+        public string control_description { get; set; }
+        public Nullable<System.DateTime> cmd_success_time { get; set; }
+        public Nullable<int> cmd_id { get; set; }
+        public string cmd_value { get; set; }
+        public Nullable<System.DateTime> send_control_time { get; set; }
+        public Nullable<bool> send_control_success { get; set; }
+        public string control_errors_code { get; set; }
+        public Nullable<System.DateTime> send_rest_time { get; set; }
+        public Nullable<bool> send_rest_success { get; set; }
+        public string reset_errors_code { get; set; }
+        public Nullable<bool> is_success { get; set; }
+    }
+}

+ 34 - 0
EntityDataSet/control_log.cs

@@ -0,0 +1,34 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class control_log
+    {
+        public int id { get; set; }
+        public string windturbine_id { get; set; }
+        public string model_id { get; set; }
+        public string station_id { get; set; }
+        public Nullable<int> control_type { get; set; }
+        public Nullable<int> cmd_id { get; set; }
+        public Nullable<double> cmd_value { get; set; }
+        public Nullable<int> control_user_id { get; set; }
+        public Nullable<System.DateTime> send_control_time { get; set; }
+        public string send_control_error_info { get; set; }
+        public Nullable<bool> is_send_control_success { get; set; }
+        public Nullable<System.DateTime> send_reset_time { get; set; }
+        public string send_reset_error_info { get; set; }
+        public Nullable<bool> is_send_reset_success { get; set; }
+        public Nullable<bool> is_send_over { get; set; }
+        public string control_info { get; set; }
+    }
+}

+ 36 - 0
EntityDataSet/electricaltestingpointai.cs

@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class electricaltestingpointai
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string MODEL { get; set; }
+        public string VALUEUNIT { get; set; }
+        public string ENGLISHNAME { get; set; }
+        public string TYPEID { get; set; }
+        public string MODELID { get; set; }
+        public Nullable<float> MAXVAL { get; set; }
+        public Nullable<float> MINVAL { get; set; }
+        public Nullable<float> REASONABLEMAXVAL { get; set; }
+        public Nullable<float> REASONABLEMINVAL { get; set; }
+        public string ELECTRICALID { get; set; }
+        public string UNIFORMCODE { get; set; }
+        public string SHORTID { get; set; }
+        public string LONGID { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public string REALTIMEID { get; set; }
+    }
+}

+ 36 - 0
EntityDataSet/electricaltestingpointdi.cs

@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class electricaltestingpointdi
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string MODEL { get; set; }
+        public string VALUEUNIT { get; set; }
+        public string ENGLISHNAME { get; set; }
+        public string TYPEID { get; set; }
+        public string MODELID { get; set; }
+        public Nullable<float> MAXVAL { get; set; }
+        public Nullable<float> MINVAL { get; set; }
+        public Nullable<float> REASONABLEMAXVAL { get; set; }
+        public Nullable<float> REASONABLEMINVAL { get; set; }
+        public string ELECTRICALID { get; set; }
+        public string UNIFORMCODE { get; set; }
+        public string SHORTID { get; set; }
+        public string LONGID { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public string REALTIMEID { get; set; }
+    }
+}

+ 22 - 0
EntityDataSet/gycp_address.cs

@@ -0,0 +1,22 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class gycp_address
+    {
+        public int id { get; set; }
+        public string project_id { get; set; }
+        public string ip { get; set; }
+        public int port { get; set; }
+    }
+}

+ 23 - 0
EntityDataSet/gycp_cmd_info.cs

@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class gycp_cmd_info
+    {
+        public int id { get; set; }
+        public int type { get; set; }
+        public int cmd_id { get; set; }
+        public Nullable<int> cmd_value { get; set; }
+        public string windturbine_id { get; set; }
+    }
+}

BIN
EntityDataSet/lib/MySql.Data.Entity.EF6.dll


+ 27 - 0
EntityDataSet/line.cs

@@ -0,0 +1,27 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class line
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string ANAME { get; set; }
+        public string PROJECTID { get; set; }
+        public Nullable<int> ORDERNUM { get; set; }
+        public Nullable<float> CAPACITY { get; set; }
+        public string CAPACITYUNIT { get; set; }
+        public Nullable<int> QUANTITY { get; set; }
+    }
+}

+ 5 - 0
EntityDataSet/packages.config

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
+  <package id="EntityFramework.zh-Hans" version="5.0.0" targetFramework="net45" />
+</packages>

+ 32 - 0
EntityDataSet/project.cs

@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class project
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string ANAME { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public Nullable<float> CAPACITY { get; set; }
+        public string CAPACITYUNIT { get; set; }
+        public Nullable<int> QUANTITY { get; set; }
+        public string MODEL { get; set; }
+        public string COMMISSIONDATE { get; set; }
+        public string MASTERPHONE { get; set; }
+        public string SHIFTFOREMAN { get; set; }
+        public string SHIFTFOREMANPHONE { get; set; }
+        public Nullable<int> ORDERNUM { get; set; }
+    }
+}

+ 34 - 0
EntityDataSet/user.cs

@@ -0,0 +1,34 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class user
+    {
+        public int id { get; set; }
+        public string user_name { get; set; }
+        public string name { get; set; }
+        public string pass_word { get; set; }
+        public string telephone { get; set; }
+        public string type { get; set; }
+        public byte[] finger1_template { get; set; }
+        public byte[] finger2_template { get; set; }
+        public byte[] finger3_template { get; set; }
+        public byte[] finger4_template { get; set; }
+        public byte[] finger5_template { get; set; }
+        public byte[] finger6_template { get; set; }
+        public byte[] finger7_template { get; set; }
+        public byte[] finger8_template { get; set; }
+        public byte[] finger9_template { get; set; }
+        public byte[] finger10_template { get; set; }
+    }
+}

+ 23 - 0
EntityDataSet/view_tspoint.cs

@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class view_tspoint
+    {
+        public string id { get; set; }
+        public string thing_type { get; set; }
+        public string thing_id { get; set; }
+        public string uniform_code { get; set; }
+        public string data_type { get; set; }
+    }
+}

+ 23 - 0
EntityDataSet/view_tspoint1.cs

@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class view_tspoint1
+    {
+        public string id { get; set; }
+        public string thing_type { get; set; }
+        public string thing_id { get; set; }
+        public string uniform_code { get; set; }
+        public string data_type { get; set; }
+    }
+}

+ 37 - 0
EntityDataSet/windpowerstation.cs

@@ -0,0 +1,37 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windpowerstation
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string ADDRESS { get; set; }
+        public string TELEPHONE { get; set; }
+        public Nullable<float> CAPACITY { get; set; }
+        public string CAPACITYUNIT { get; set; }
+        public Nullable<int> QUANTITY { get; set; }
+        public string ANAME { get; set; }
+        public Nullable<float> LONGITUDE { get; set; }
+        public Nullable<float> LATITUDE { get; set; }
+        public string PHOTO { get; set; }
+        public string COMPANYID { get; set; }
+        public string SYSTEMMANUFACT { get; set; }
+        public string HEADFARM { get; set; }
+        public string HEADFARMPHONE { get; set; }
+        public string MODEL { get; set; }
+        public Nullable<int> ORDERNUM { get; set; }
+        public Nullable<float> ALTITUDE { get; set; }
+    }
+}

+ 34 - 0
EntityDataSet/windpowerstationtestingpoint.cs

@@ -0,0 +1,34 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windpowerstationtestingpoint
+    {
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string MODEL { get; set; }
+        public string VALUEUNIT { get; set; }
+        public string ENGLISHNAME { get; set; }
+        public string TYPEID { get; set; }
+        public string MODELID { get; set; }
+        public Nullable<float> MAXVAL { get; set; }
+        public Nullable<float> MINVAL { get; set; }
+        public Nullable<float> REASONABLEMAXVAL { get; set; }
+        public Nullable<float> REASONABLEMINVAL { get; set; }
+        public string UNIFORMCODE { get; set; }
+        public string SHORTID { get; set; }
+        public string LONGID { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public string REALTIMEID { get; set; }
+    }
+}

+ 32 - 0
EntityDataSet/windturbine.cs

@@ -0,0 +1,32 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windturbine
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public Nullable<float> LONGITUDE { get; set; }
+        public Nullable<float> LATITUDE { get; set; }
+        public string MODELID { get; set; }
+        public string STATUS { get; set; }
+        public string PROJECTID { get; set; }
+        public string LINEID { get; set; }
+        public string FIRSTINTEGRATEDTIME { get; set; }
+        public string PHOTO { get; set; }
+        public string NAME { get; set; }
+        public string STANDARDID { get; set; }
+        public Nullable<int> GYCP_ID { get; set; }
+    }
+}

+ 46 - 0
EntityDataSet/windturbine_uniform_code.cs

@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windturbine_uniform_code
+    {
+        public int id { get; set; }
+        public string station_id { get; set; }
+        public string line_id { get; set; }
+        public string windturbine_id { get; set; }
+        public string model_id { get; set; }
+        public string project_id { get; set; }
+        public Nullable<bool> is_lock { get; set; }
+        public string status_uniform_code { get; set; }
+        public string hung_uniform_code { get; set; }
+        public string wind_speed_uniform_code { get; set; }
+        public string power_uniform_code { get; set; }
+        public string alternator_speed_uniform_code { get; set; }
+        public string lamina_speed_uniform_code { get; set; }
+        public string limit_speed_uniform_code { get; set; }
+        public string lamina_angle1_uniform_code { get; set; }
+        public string lamina_angle2_uniform_code { get; set; }
+        public string lamina_angle3_uniform_code { get; set; }
+        public string wind_angle_uniform_code { get; set; }
+        public string yaw_position_uniform_code { get; set; }
+        public string online_uniform_code { get; set; }
+        public string standby_uniform_code { get; set; }
+        public string fault_uniform_code { get; set; }
+        public string maintain_uniform_code { get; set; }
+        public string offline_uniform_code { get; set; }
+        public string start_uniform_code { get; set; }
+        public string cold_start_uniform_code { get; set; }
+        public string stop_uniform_code { get; set; }
+        public string onpower_uniform_code { get; set; }
+    }
+}

+ 36 - 0
EntityDataSet/windturbinetestingpointai.cs

@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windturbinetestingpointai
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string MODEL { get; set; }
+        public string VALUEUNIT { get; set; }
+        public string ENGLISHNAME { get; set; }
+        public string TYPEID { get; set; }
+        public string MODELID { get; set; }
+        public Nullable<float> MAXVAL { get; set; }
+        public Nullable<float> MINVAL { get; set; }
+        public Nullable<float> REASONABLEMAXVAL { get; set; }
+        public Nullable<float> REASONABLEMINVAL { get; set; }
+        public string WINDTURBINEID { get; set; }
+        public string UNIFORMCODE { get; set; }
+        public string SHORTID { get; set; }
+        public string LONGID { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public string REALTIMEID { get; set; }
+    }
+}

+ 36 - 0
EntityDataSet/windturbinetestingpointdi.cs

@@ -0,0 +1,36 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//    此代码是根据模板生成的。
+//
+//    手动更改此文件可能会导致应用程序中发生异常行为。
+//    如果重新生成代码,则将覆盖对此文件的手动更改。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace EntityDataSet
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class windturbinetestingpointdi
+    {
+        public string ID { get; set; }
+        public string CODE { get; set; }
+        public string NAME { get; set; }
+        public string MODEL { get; set; }
+        public string VALUEUNIT { get; set; }
+        public string ENGLISHNAME { get; set; }
+        public string TYPEID { get; set; }
+        public string MODELID { get; set; }
+        public Nullable<float> MAXVAL { get; set; }
+        public Nullable<float> MINVAL { get; set; }
+        public Nullable<float> REASONABLEMAXVAL { get; set; }
+        public Nullable<float> REASONABLEMINVAL { get; set; }
+        public string WINDTURBINEID { get; set; }
+        public string UNIFORMCODE { get; set; }
+        public string SHORTID { get; set; }
+        public string LONGID { get; set; }
+        public string WINDPOWERSTATIONID { get; set; }
+        public string REALTIMEID { get; set; }
+    }
+}

+ 58 - 0
GDNXFD.Alert.Config/App.config

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework"
+      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
+      requirePermission="false"/>
+    <section name="oracle.manageddataaccess.client"
+      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
+  </startup>
+  <entityFramework>
+    <defaultConnectionFactory type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    <providers>
+      <provider invariantName="Oracle.ManagedDataAccess.Client"
+        type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    </providers>
+  </entityFramework>
+  <system.data>
+    <DbProviderFactories>
+      <remove invariant="Oracle.ManagedDataAccess.Client"/>
+      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
+        type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    </DbProviderFactories>
+  </system.data>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <publisherPolicy apply="no"/>
+        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
+        <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0"/>
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+  <oracle.manageddataaccess.client>
+    <version number="*">
+      <dataSources>
+        <dataSource alias="SampleDataSource"
+          descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.168.1.14)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=gdnxfd))) "/>
+      </dataSources>
+    </version>
+  </oracle.manageddataaccess.client>
+  <oracle.dataaccess.client>
+    <settings>
+      <add name="bool" value="edmmapping number(1,0)"/>
+      <add name="byte" value="edmmapping number(3,0)"/>
+      <add name="int16" value="edmmapping number(4,0)"/>
+      <add name="int32" value="edmmapping number(9,0)"/>
+      <add name="int64" value="edmmapping number(18,0)"/>
+    </settings>
+  </oracle.dataaccess.client>
+  <connectionStrings>
+    <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client"
+      connectionString="Data Source=  (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = 172.168.1.14)(PORT = 1521))     (CONNECT_DATA =       (SERVER = DEDICATED)       (SERVICE_NAME = gdnxfd)     )   );User Id=nxfdprod;Password=gdnxfd123;"/>
+  </connectionStrings>
+</configuration>

+ 30 - 0
GDNXFD.Alert.Config/App.xaml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Application x:Class="GDNXFD.Alert.Config.App" 
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
+             Startup="App_Startup"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
+             xmlns:vm="clr-namespace:GDNXFD.Alert.Config.ViewModel" 
+             xmlns:converters="clr-namespace:GDNXFD.Alert.Config.Converters"
+             xmlns:resx="clr-namespace:GDNXFD.Alert.Config.Resources.Strings">
+    <Application.Resources>
+        <ResourceDictionary>
+            <ObjectDataProvider x:Key="Provider" ObjectType="{x:Type resx:StringProvider}" MethodName="GetResourceInstance"/>
+            <!--<vm:ViewModelLocator x:Key="Locator"/>-->
+
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="/Resources/Common/Buttons.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/Colors.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/CommonResources.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/ItemsPanel.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/ItemsTemplates.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/RadioButtonStyles.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/TextBlocks.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/InputElements.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/TextBoxes.xaml"/>
+                <ResourceDictionary Source="/Resources/Common/Scroll.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Application.Resources>
+</Application>

+ 32 - 0
GDNXFD.Alert.Config/App.xaml.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace GDNXFD.Alert.Config
+{
+    /// <summary>e
+    /// Interaction logic for App.xaml
+    /// </summary>
+    public partial class App : Application
+    {
+        void App_Startup(object sender, StartupEventArgs e)
+        {
+            try
+            {
+                // Start the application anyway to show error message
+                Views.MainWindow main = new Views.MainWindow();
+                main.Show();
+            }
+            catch (Exception ex)
+            {
+                System.Diagnostics.Debug.WriteLine(ex);
+                Views.ErrorWindow main = new Views.ErrorWindow();
+                main.Show();
+            }
+        }
+    }
+}

+ 58 - 0
GDNXFD.Alert.Config/App2.config

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <configSections>
+    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
+    <section name="entityFramework"
+      type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
+      requirePermission="false"/>
+    <section name="oracle.manageddataaccess.client"
+      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+  </configSections>
+  <startup>
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
+  </startup>
+  <entityFramework>
+    <defaultConnectionFactory type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    <providers>
+      <provider invariantName="Oracle.ManagedDataAccess.Client"
+        type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    </providers>
+  </entityFramework>
+  <system.data>
+    <DbProviderFactories>
+      <remove invariant="Oracle.ManagedDataAccess.Client"/>
+      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
+        type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
+    </DbProviderFactories>
+  </system.data>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <publisherPolicy apply="no"/>
+        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
+        <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0"/>
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+  <oracle.manageddataaccess.client>
+    <version number="*">
+      <dataSources>
+        <dataSource alias="SampleDataSource"
+          descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.100)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=gdnxfd))) "/>
+      </dataSources>
+    </version>
+  </oracle.manageddataaccess.client>
+  <oracle.dataaccess.client>
+    <settings>
+      <add name="bool" value="edmmapping number(1,0)"/>
+      <add name="byte" value="edmmapping number(3,0)"/>
+      <add name="int16" value="edmmapping number(4,0)"/>
+      <add name="int32" value="edmmapping number(9,0)"/>
+      <add name="int64" value="edmmapping number(18,0)"/>
+    </settings>
+  </oracle.dataaccess.client>
+  <connectionStrings>
+    <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client"
+      connectionString="Data Source=  (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))     (CONNECT_DATA =       (SERVER = DEDICATED)       (SERVICE_NAME = gdnxfd)     )   );User Id=nxfdprod;Password=gdnxfd123;"/>
+  </connectionStrings>
+</configuration>

+ 25 - 0
GDNXFD.Alert.Config/Cache/GlobalVar.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GDNXFD.Alert.Config
+{
+    public class GlobalVar 
+    {
+
+        private GlobalVar()
+        {
+
+        }
+
+        /// <summary>
+        /// 当前登录的用户
+        /// </summary>
+        public static string CurrentUser { get; set; }
+    }
+}

+ 36 - 0
GDNXFD.Alert.Config/Controls/ComboBoxKeyboard.cs

@@ -0,0 +1,36 @@
+namespace GDNXFD.Alert.Config.Controls
+{
+    using GDNXFD.Alert.Config.Helpers;
+    using System;
+    using System.Threading;
+    using System.Threading.Tasks;
+    using System.Windows.Controls;
+
+    /// <summary>
+    /// Combobox with virtual Keyboard
+    /// </summary>.
+    public class ComboBoxKeyboard : ComboBox
+    {
+        private TabtipHelper tabtipHelper = TabtipHelper.Instance;
+
+        /// <summary>
+        /// On got focus.
+        /// </summary>
+        /// <param name="e">Event args</param>
+        protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e)
+        {
+            tabtipHelper.TryCreateTabtipProcess();
+            base.OnGotKeyboardFocus(e);
+        }
+
+        /// <summary>
+        /// On lost focus.
+        /// </summary>
+        /// <param name="e">Event args</param>
+        protected override void OnLostKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e)
+        {
+            tabtipHelper.TryKillTabtipProcess();
+            base.OnLostKeyboardFocus(e);
+        }
+    }
+}

+ 44 - 0
GDNXFD.Alert.Config/Controls/CustomDialog.xaml

@@ -0,0 +1,44 @@
+<UserControl x:Class="GDNXFD.Alert.Config.Controls.CustomDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             mc:Ignorable="d"
+             d:DesignHeight="800" d:DesignWidth="1200">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition></ColumnDefinition>
+            <ColumnDefinition></ColumnDefinition>
+            <ColumnDefinition></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Border Background="Black" Opacity="0.5" Grid.RowSpan="3" Grid.ColumnSpan="3"/>
+        <Border Background="{StaticResource module-background-color-brush}" Grid.Row="1" Grid.Column="0"
+                Width="400" Height="210" Grid.ColumnSpan="3" Padding="20,40,20,40">
+            <Grid>
+                <TextBlock Grid.Row="0" Text="{Binding Message}" VerticalAlignment="Top"
+                           HorizontalAlignment="Center" Style="{StaticResource MessagesTextStyle}"
+                           TextWrapping="Wrap" TextAlignment="Center"></TextBlock>
+
+                
+                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
+                    <Button Style="{StaticResource ConfirmButtonStyle}"  Height="40" Width="80" Focusable="True" TabIndex="1"
+                        HorizontalAlignment="Left" VerticalAlignment="Bottom" 
+                        Command="{Binding AcceptCommand}" IsDefault="True">
+                        <Image Source="/Resources/Images/check-big.png" Stretch="None"></Image>
+                    </Button>
+                    <Button Name="CancelButton" Style="{StaticResource CancelButtonStyle}" Height="40" Width="80" Visibility="{Binding ShowCancel}" Focusable="True" TabIndex="0"
+                            IsVisibleChanged="CancelButton_IsVisibleChanged"    
+                            HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="20,0,0,0" IsDefault="True"
+                            Command="{Binding CancelCommand}" IsCancel="True">
+                        <Image Source="/Resources/Images/cancel2.png" Height="17" Width="17"></Image>
+                    </Button>
+                </StackPanel>
+            </Grid>
+        </Border>   
+    </Grid>
+</UserControl>

+ 25 - 0
GDNXFD.Alert.Config/Controls/CustomDialog.xaml.cs

@@ -0,0 +1,25 @@
+namespace GDNXFD.Alert.Config.Controls
+{
+    using System.Windows.Controls;
+
+    /// <summary>
+    /// Interaction logic for CustomDialog.xaml
+    /// </summary>
+    public partial class CustomDialog : UserControl
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        public CustomDialog()
+        {
+            InitializeComponent();
+        }
+
+        private void CancelButton_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
+        {
+            if ((bool)e.NewValue)
+                this.CancelButton.Focus();
+        }
+
+    }
+}

+ 342 - 0
GDNXFD.Alert.Config/Controls/LoadingControl.xaml

@@ -0,0 +1,342 @@
+<UserControl x:Class="GDNXFD.Alert.Config.Controls.LoadingControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             mc:Ignorable="d" 
+             xmlns:gif="http://wpfanimatedgif.codeplex.com">
+    <UserControl.Resources>
+        <Storyboard x:Key="LoadingAnimation" AutoReverse="True" RepeatBehavior="Forever">
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse1">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse1">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse2">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse2">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse3">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse3">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse4">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse4">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse5">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse5">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse6">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse6">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="ellipse7">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="ellipse7">
+                <EasingDoubleKeyFrame KeyTime="0" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="25">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+                <EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="15">
+                    <EasingDoubleKeyFrame.EasingFunction>
+                        <QuarticEase EasingMode="EaseInOut"/>
+                    </EasingDoubleKeyFrame.EasingFunction>
+                </EasingDoubleKeyFrame>
+            </DoubleAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse">
+                <EasingColorKeyFrame KeyTime="0:0:0.1" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse1">
+                <EasingColorKeyFrame KeyTime="0:0:0.2" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse2">
+                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.5" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse3">
+                <EasingColorKeyFrame KeyTime="0:0:0.4" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.5" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.6" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse4">
+                <EasingColorKeyFrame KeyTime="0:0:0.5" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.6" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.7" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse5">
+                <EasingColorKeyFrame KeyTime="0:0:0.6" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.7" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.8" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse6">
+                <EasingColorKeyFrame KeyTime="0:0:0.7" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.8" Value="{StaticResource  loading-darkest-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.9" Value="{StaticResource  module-primary-color}"/>
+            </ColorAnimationUsingKeyFrames>
+            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse7">
+                <EasingColorKeyFrame KeyTime="0:0:0.8" Value="{StaticResource  module-primary-color}"/>
+                <EasingColorKeyFrame KeyTime="0:0:0.9" Value="{StaticResource  loading-darkest-color}"/>
+            </ColorAnimationUsingKeyFrames>
+        </Storyboard>
+    </UserControl.Resources>
+    <UserControl.Triggers>
+        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
+            <BeginStoryboard Storyboard="{StaticResource LoadingAnimation}"/>
+        </EventTrigger>
+    </UserControl.Triggers>
+    <Grid>
+        <Border Background="{StaticResource module-background-color-brush }">
+            <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Center">
+                <Ellipse x:Name="ellipse" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse1" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse2" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse3" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse4" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse5" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse6" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+                <Ellipse x:Name="ellipse7" Width="15" Height="15" Fill="{StaticResource  module-primary-color-brush}" Margin="5"></Ellipse>
+            </StackPanel>
+        </Border>
+    </Grid>
+</UserControl>

+ 18 - 0
GDNXFD.Alert.Config/Controls/LoadingControl.xaml.cs

@@ -0,0 +1,18 @@
+namespace GDNXFD.Alert.Config.Controls
+{
+    using System.Windows.Controls;
+
+    /// <summary>
+    /// Interaction logic for LoadingControl.xaml
+    /// </summary>
+    public partial class LoadingControl : UserControl
+    {
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        public LoadingControl()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 99 - 0
GDNXFD.Alert.Config/Controls/MultiSelectComboBox.xaml

@@ -0,0 +1,99 @@
+<UserControl x:Class="GDNXFD.Alert.Config.Controls.MultiSelectComboBox"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             >
+    <ComboBox
+        x:Name="MultiSelectCombo"  
+        SnapsToDevicePixels="True"
+        OverridesDefaultStyle="True"
+        ScrollViewer.HorizontalScrollBarVisibility="Auto"
+        ScrollViewer.VerticalScrollBarVisibility="Auto"
+        ScrollViewer.CanContentScroll="True"
+        IsSynchronizedWithCurrentItem="True"
+                           >
+        <ComboBox.ItemTemplate>
+            <DataTemplate>
+                <CheckBox Content="{Binding Title}"
+                          IsChecked="{Binding Path=IsSelected, Mode=TwoWay}"
+                          Tag="{RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}"
+                           Click="CheckBox_Click"           />
+            </DataTemplate>
+        </ComboBox.ItemTemplate>
+        <ComboBox.Template>
+            <ControlTemplate TargetType="ComboBox">
+                <Grid >
+                    <ToggleButton 
+                        x:Name="ToggleButton" 
+                       Grid.Column="2" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
+                        Focusable="false"                           
+                        ClickMode="Press" HorizontalContentAlignment="Left" >
+                        <ToggleButton.Template>
+                            <ControlTemplate>
+                                <Grid>
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="*"/>
+                                        <ColumnDefinition Width="18"/>
+                                    </Grid.ColumnDefinitions>
+                                    <Border
+                  x:Name="Border" 
+                  Grid.ColumnSpan="2"
+                  CornerRadius="2"
+                  Background="White"
+                  BorderBrush="Black"
+                  BorderThickness="1,1,1,1" />
+                                    <Border 
+                    x:Name="BorderComp" 
+                  Grid.Column="0"
+                  CornerRadius="2" 
+                  Margin="1" 
+                 Background="White"
+                  BorderBrush="Black"
+                  BorderThickness="0,0,0,0" >
+                                        <TextBlock Text="{Binding Path=Text,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" 
+                                               Background="White" Padding="3" />
+                                    </Border>
+                                    <Path 
+                  x:Name="Arrow"
+                  Grid.Column="1"     
+                  Fill="Black"
+                  HorizontalAlignment="Center"
+                  VerticalAlignment="Center"
+                  Data="M 0 0 L 4 4 L 8 0 Z"/>
+                                </Grid>
+                            </ControlTemplate>
+                        </ToggleButton.Template>
+                    </ToggleButton>
+                    <Popup 
+                        Name="Popup"
+                        Placement="Bottom"                        
+                        AllowsTransparency="True" 
+                        Focusable="False"  IsOpen="{TemplateBinding IsDropDownOpen}"
+                        PopupAnimation="Slide">
+                        <Grid 
+                                  Name="DropDown"
+                                  SnapsToDevicePixels="True"  
+                            MinWidth="{TemplateBinding ActualWidth}"
+                                  MaxHeight="{TemplateBinding MaxDropDownHeight}">
+                            <Border 
+                                    x:Name="DropDownBorder" 
+                                   BorderThickness="1" Background="White"
+                                    BorderBrush="Black"/>
+                            <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" DataContext="{Binding}">
+                                <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
+                            </ScrollViewer>
+                        </Grid>
+                    </Popup>
+                </Grid>
+                <ControlTemplate.Triggers>
+                    <Trigger Property="HasItems" Value="false">
+                        <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
+                    </Trigger>
+                    <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
+                        <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
+                        <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
+                    </Trigger>
+                </ControlTemplate.Triggers>
+            </ControlTemplate>
+        </ComboBox.Template>
+    </ComboBox>
+</UserControl>

+ 286 - 0
GDNXFD.Alert.Config/Controls/MultiSelectComboBox.xaml.cs

@@ -0,0 +1,286 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+
+namespace GDNXFD.Alert.Config.Controls
+{
+    /// <summary>
+    /// Interaction logic for MultiSelectComboBox.xaml
+    /// </summary>
+    public partial class MultiSelectComboBox : UserControl
+    {
+        private ObservableCollection<Node> _nodeList;
+        public MultiSelectComboBox()
+        {
+            InitializeComponent();
+            _nodeList = new ObservableCollection<Node>();
+        }
+
+        #region Dependency Properties
+
+        public static readonly DependencyProperty ItemsSourceProperty =
+             DependencyProperty.Register("ItemsSource", typeof(Dictionary<string, object>), typeof(MultiSelectComboBox), new FrameworkPropertyMetadata(null,
+        new PropertyChangedCallback(MultiSelectComboBox.OnItemsSourceChanged)));
+
+        public static readonly DependencyProperty SelectedItemsProperty =
+         DependencyProperty.Register("SelectedItems", typeof(Dictionary<string, object>), typeof(MultiSelectComboBox), new FrameworkPropertyMetadata(null,
+     new PropertyChangedCallback(MultiSelectComboBox.OnSelectedItemsChanged)));
+
+//        public static readonly DependencyProperty SelectedItemsProperty =
+//DependencyProperty.Register("SelectedItems", typeof(Dictionary<string, object>), typeof(MultiSelectComboBox), new UIPropertyMetadata(null));
+
+
+        public static readonly DependencyProperty TextProperty =
+           DependencyProperty.Register("Text", typeof(string), typeof(MultiSelectComboBox), new UIPropertyMetadata(string.Empty));
+
+        public static readonly DependencyProperty DefaultTextProperty =
+            DependencyProperty.Register("DefaultText", typeof(string), typeof(MultiSelectComboBox), new UIPropertyMetadata(string.Empty));
+
+
+
+        public Dictionary<string, object> ItemsSource
+        {
+            get { return (Dictionary<string, object>)GetValue(ItemsSourceProperty); }
+            set
+            {
+                SetValue(ItemsSourceProperty, value);
+            }
+        }
+
+        public Dictionary<string, object> SelectedItems
+        {
+            get { return (Dictionary<string, object>)GetValue(SelectedItemsProperty); }
+            set
+            {
+                SetValue(SelectedItemsProperty, value);
+            }
+        }
+
+        public string Text
+        {
+            get { return (string)GetValue(TextProperty); }
+            set { SetValue(TextProperty, value); }
+        }
+
+        public string DefaultText
+        {
+            get { return (string)GetValue(DefaultTextProperty); }
+            set { SetValue(DefaultTextProperty, value); }
+        }
+        #endregion
+
+        #region Events
+        private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            MultiSelectComboBox control = (MultiSelectComboBox)d;
+            control.DisplayInControl();
+        }
+
+        private static void OnSelectedItemsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            MultiSelectComboBox control = (MultiSelectComboBox)d;
+            control.SelectNodes();
+            control.SetText();
+        }
+
+        private void CheckBox_Click(object sender, RoutedEventArgs e)
+        {
+            var xxx = SelectedItems;
+
+            CheckBox clickedBox = (CheckBox)sender;
+
+            if (clickedBox.Content == "全部" )
+            {
+                if (clickedBox.IsChecked.Value)
+                {
+                    foreach (Node node in _nodeList)
+                    {
+                        node.IsSelected = true;
+                    }
+                }
+                else
+                {
+                    foreach (Node node in _nodeList)
+                    {
+                        node.IsSelected = false;
+                    }
+                }
+
+            }
+            else
+            {
+                int _selectedCount = 0;
+                foreach (Node s in _nodeList)
+                {
+                    if (s.IsSelected && s.Title != "全部")
+                        _selectedCount++;
+                }
+                if (_selectedCount == _nodeList.Count - 1)
+                    _nodeList.FirstOrDefault(i => i.Title == "全部").IsSelected = true;
+                else
+                    _nodeList.FirstOrDefault(i => i.Title == "全部").IsSelected = false;
+            }
+            SetSelectedItems();
+            SetText();
+            if (SelectionChanged != null)
+            {
+                SelectionChanged(this, e);
+            }
+        }
+        #endregion
+
+
+        #region Methods
+        private void SelectNodes()
+        {
+            foreach (KeyValuePair<string, object> keyValue in SelectedItems)
+            {
+                Node node = _nodeList.FirstOrDefault(i => i.Title == keyValue.Key);
+                if (node != null)
+                    node.IsSelected = true;
+            }
+
+            if (SelectedItems != null && SelectedItems.Count == ItemsSource.Count)
+            {
+                Node node = _nodeList.FirstOrDefault(i => i.Title == "全部");
+                if (node != null)
+                    node.IsSelected = true;
+            }
+        }
+
+        private void SetSelectedItems()
+        {
+            if (SelectedItems == null)
+                SelectedItems = new Dictionary<string, object>();
+            SelectedItems.Clear();
+            foreach (Node node in _nodeList)
+            {
+                if (node.IsSelected && node.Title != "全部")
+                {
+                    if (this.ItemsSource.Count > 0)
+
+                        SelectedItems.Add(node.Title, this.ItemsSource[node.Title]);
+                }
+            }
+        }
+
+        private void DisplayInControl()
+        {
+            _nodeList.Clear();
+            if (this.ItemsSource.Count > 0)
+                _nodeList.Add(new Node("全部"));
+            foreach (KeyValuePair<string, object> keyValue in this.ItemsSource)
+            {
+                Node node = new Node(keyValue.Key);
+                _nodeList.Add(node);
+            }
+            MultiSelectCombo.ItemsSource = _nodeList;
+        }
+
+        private void SetText()
+        {
+            if (this.SelectedItems != null)
+            {
+
+                StringBuilder displayText = new StringBuilder();
+                foreach (Node s in _nodeList)
+                {
+                    if (s.IsSelected == true && s.Title == "全部")
+                    {
+                        displayText = new StringBuilder();
+                        displayText.Append("全部");
+                        break;
+                    }
+                    else if (s.IsSelected == true && s.Title != "全部")
+                    {
+                        displayText.Append(s.Title);
+                        displayText.Append(',');
+                    }
+                }
+                this.Text = displayText.ToString().TrimEnd(new char[] { ',' });
+                
+            }           
+            // set DefaultText if nothing else selected
+            if (string.IsNullOrEmpty(this.Text))
+            {
+                this.Text = this.DefaultText;
+            }
+            this.ToolTip = this.Text;
+        }
+
+
+        #endregion
+
+        #region 自定义事件
+
+        public event EventHandler SelectionChanged;
+
+
+        #endregion
+
+
+
+    }
+
+    public class Node : INotifyPropertyChanged
+    {
+
+        private string _title;
+        private bool _isSelected;
+        #region ctor
+        public Node(string title)
+        {
+            Title = title;
+        }
+        #endregion
+
+        #region Properties
+        public string Title
+        {
+            get
+            {
+                return _title;
+            }
+            set
+            {
+                _title = value;
+                NotifyPropertyChanged("Title");
+            }
+        }
+        public bool IsSelected
+        {
+            get
+            {
+                return _isSelected;
+            }
+            set
+            {
+                _isSelected = value;
+                NotifyPropertyChanged("IsSelected");
+            }
+        }
+        #endregion
+
+        public event PropertyChangedEventHandler PropertyChanged;
+        protected void NotifyPropertyChanged(string propertyName)
+        {
+            if (PropertyChanged != null)
+            {
+                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+            }
+        }
+
+    }
+}

+ 40 - 0
GDNXFD.Alert.Config/Controls/TextBoxKeyboard.cs

@@ -0,0 +1,40 @@
+namespace GDNXFD.Alert.Config.Controls
+{
+    using GDNXFD.Alert.Config.Helpers;
+    using GDNXFD.Alert.Config.Views;
+    using System;
+    using System.Threading;
+    using System.Threading.Tasks;
+    using System.Windows.Controls;
+    using System.Windows.Input;
+    //using Windows.Devices.Input;
+
+
+    /// <summary>
+    /// Textbox with virtual Keyboard
+    /// </summary>.
+    public partial class TextBoxKeyboard : TextBox
+    {
+        private TabtipHelper tabtipHelper = TabtipHelper.Instance;
+
+        /// <summary>
+        /// On got focus.
+        /// </summary>
+        /// <param name="e">Event args</param>
+        protected override void OnGotFocus(System.Windows.RoutedEventArgs e)
+        {
+            tabtipHelper.TryCreateTabtipProcess();
+            base.OnGotFocus(e);
+        }
+
+        /// <summary>
+        /// On lost focus.
+        /// </summary>
+        /// <param name="e">Event args</param>
+        protected override void OnLostFocus(System.Windows.RoutedEventArgs e)
+        {
+            tabtipHelper.TryKillTabtipProcess();
+            base.OnLostFocus(e);
+        }
+    }
+}

+ 30 - 0
GDNXFD.Alert.Config/Converters/BooleanToEnabledDisabledConverter.cs

@@ -0,0 +1,30 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Globalization;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+    using System.Windows;
+    using System.Windows.Data;
+
+    public class BooleanToEnabledDisabledConverter : IValueConverter
+    {
+        private const string EnabledText = "启用";
+        private const string DisabledText = "停用";
+
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return Equals(true, value)
+                ? EnabledText
+                : DisabledText;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            //Actually won't be used, but in case you need that
+            return Equals(value, EnabledText);
+        }
+    }
+}

+ 48 - 0
GDNXFD.Alert.Config/Converters/BooleanToRadioButtonConverter.cs

@@ -0,0 +1,48 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Windows;
+    using System.Windows.Data;
+
+    /// <summary>
+    /// enum to bool converter
+    /// </summary>
+    public class BooleanToRadioButtonConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a travel type to bool.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value is bool)
+            {
+                return !(bool)value;
+            }
+
+            return value;
+        }
+
+        /// <summary>
+        /// Convert back
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value is bool)
+            {
+                return !(bool)value;
+            }
+
+            return value;
+        }
+    }
+}

+ 47 - 0
GDNXFD.Alert.Config/Converters/BooleanToVisibilityConverter.cs

@@ -0,0 +1,47 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+    using System.Windows;
+    using System.Windows.Data;
+
+    /// <summary>
+    /// Boolean to visibility converter.
+    /// </summary>
+    public class BooleanToVisibilityConverter : IValueConverter
+    {
+        /// <summary>
+        /// Converts a boolean value to a visibility value.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            bool val = System.Convert.ToBoolean(value);
+            if (val)
+            {
+                return Visibility.Visible;
+            }
+            return Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// Not implemented.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 48 - 0
GDNXFD.Alert.Config/Converters/ByteToImageConverter.cs

@@ -0,0 +1,48 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class ByteToImageConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                BitmapImage bi = new BitmapImage();
+                bi.BeginInit();
+                bi.StreamSource = new MemoryStream((byte[])value);
+                bi.EndInit();
+
+                return bi;
+            }
+            return null;
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 51 - 0
GDNXFD.Alert.Config/Converters/Category2ToTextConverter.cs

@@ -0,0 +1,51 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class Category2ToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string code = value.ToString().Trim();
+                switch (code)
+                {
+                    case "SYZ":
+                        return "升压站";
+                    case "GF":
+                        return "光伏";
+                }
+            }
+
+            return "未知";
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 57 - 0
GDNXFD.Alert.Config/Converters/CategoryCodeToTextConverter.cs

@@ -0,0 +1,57 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class CategoryCodeToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string code = value.ToString().Trim();
+                switch (code)
+                {
+                    case "1":
+                        return "风机";
+                    case "2":
+                        return "风场";
+                    case "3":
+                        return "工程";
+                    case "4":
+                        return "线路";
+                    case "5":
+                        return "电气";
+                }
+            }
+
+            return "未知";
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 47 - 0
GDNXFD.Alert.Config/Converters/EmployeeToVisibilityConverter.cs

@@ -0,0 +1,47 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+    using System.Windows;
+    using System.Windows.Data;
+
+    /// <summary>
+    /// Employee to visibility converter.
+    /// </summary>
+    public class EmployeeToVisibilityConverter : IValueConverter
+    {
+        /// <summary>
+        /// Converts a boolean value to a visibility value.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            var val = value as Employee;
+            if (val != null)
+            {
+                return Visibility.Visible;
+            }
+            return Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// Not implemented.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 59 - 0
GDNXFD.Alert.Config/Converters/EnumToBooleanConverter.cs

@@ -0,0 +1,59 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Windows;
+    using System.Windows.Data;
+
+    /// <summary>
+    /// enum to bool converter
+    /// </summary>
+    public class EnumToBooleanConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a travel type to bool.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string parameterString = parameter as string;
+                if (parameterString == null)
+                    return DependencyProperty.UnsetValue;
+
+                if (Enum.IsDefined(value.GetType(), value) == false)
+                    return DependencyProperty.UnsetValue;
+
+                object parameterValue = Enum.Parse(value.GetType(), parameterString);
+
+                return parameterValue.Equals(value);
+            }
+
+            return null;
+        }
+
+        /// <summary>
+        /// Convert back
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null && (bool)value)
+            {
+                string parameterString = parameter as string;
+                if (!string.IsNullOrEmpty(parameterString))
+                    return Enum.Parse(targetType, parameterString);
+            }
+
+            return DependencyProperty.UnsetValue;
+        }
+    }
+}

+ 47 - 0
GDNXFD.Alert.Config/Converters/IdToVisibilityConverter.cs

@@ -0,0 +1,47 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+    using System.Windows;
+    using System.Windows.Data;
+
+    /// <summary>
+    /// Boolean to visibility converter.
+    /// </summary>
+    public class IdToVisibilityConverter : IValueConverter
+    {
+        /// <summary>
+        /// Converts a boolean value to a visibility value.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            int val = System.Convert.ToInt32(value);
+            if (val>0)
+            {
+                return Visibility.Visible;
+            }
+            return Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// Not implemented.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 57 - 0
GDNXFD.Alert.Config/Converters/LevelIdToTextConverter.cs

@@ -0,0 +1,57 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class LevelIdToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string code = value.ToString().Trim();
+                switch (code)
+                {
+                    case "LOLO":
+                        return "低";
+                    case "LO":
+                        return "中低";
+                    case "MEDIUM":
+                        return "中";
+                    case "HI":
+                        return "中高";
+                    case "HIHI":
+                        return "高";
+                }
+            }
+
+            return "未知";
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 57 - 0
GDNXFD.Alert.Config/Converters/RankCodeToTextConverter.cs

@@ -0,0 +1,57 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class RankCodeToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string code = value.ToString().Trim();
+                switch (code)
+                {
+                    case "1":
+                        return "低";
+                    case "2":
+                        return "中低";
+                    case "3":
+                        return "中";
+                    case "4":
+                        return "中高";
+                    case "5":
+                        return "高";
+                }
+            }
+
+            return "未知";
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 65 - 0
GDNXFD.Alert.Config/Converters/StationIdToTextConverter.cs

@@ -0,0 +1,65 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// Byte to image converter
+    /// </summary>
+    public class StationIdToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a byte array to an image.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                string code = value.ToString().Trim();
+                switch (code)
+                {
+                    case "MHS_FDC":
+                        return "麻黄山风电场";
+                    case "NSS_FDC":
+                        return "牛首山风电场";
+                    case "QS_FDC":
+                        return "青山风电场";
+                    case "SBQ_FDC":
+                        return "石板泉风电场";
+                    case "XS_FDC":
+                        return "香山风电场";
+                    case "DWK_GDC":
+                        return "大武口光伏电站";
+                    case "PL_GDC":
+                        return "平罗光伏电站";
+                    case "MCH_GDC":
+                        return "马场湖光伏电站";
+                    case "XH_GDC":
+                        return "宣和光伏电站";
+                }
+            }
+
+            return "未知";
+        }
+
+        /// <summary>
+        /// Convert an image to a byte array
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 56 - 0
GDNXFD.Alert.Config/Converters/TravelTypeToTextConverter.cs

@@ -0,0 +1,56 @@
+namespace GDNXFD.Alert.Config.Converters
+{
+    using GDNXFD.Alert.Config.Resources.Strings;
+    using System;
+    using System.IO;
+    using System.Windows.Data;
+    using System.Windows.Media.Imaging;
+
+    /// <summary>
+    /// travel type to text converter
+    /// </summary>
+    public class TravelTypeToTextConverter : IValueConverter
+    {
+        /// <summary>
+        /// Convert a travel type to text.
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            if (value != null)
+            {
+                TravelType travelType = (TravelType)value;
+                switch (travelType)
+                {
+                    case TravelType.Unknown:
+                        return StringProvider.GetString("TravelTypeUnkown");
+                    case TravelType.OneWay:
+                        return StringProvider.GetString("TravelTypeOneWay");
+                    case TravelType.Roundtrip:
+                        return StringProvider.GetString("TravelTypeRoundTrip");
+                    default:
+                        break;
+                }
+            }
+
+            return null;
+        }
+
+        /// <summary>
+        /// Convert back
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="targetType"></param>
+        /// <param name="parameter"></param>
+        /// <param name="culture"></param>
+        /// <returns></returns>
+        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 359 - 0
GDNXFD.Alert.Config/GDNXFD.Alert.Config.csproj

@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1939AC16-DCD0-4D8A-8F59-B2CEF1628773}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>GDNXFD.Alert.Config</RootNamespace>
+    <AssemblyName>GDNXFD.Alert.Config</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <TargetZone>LocalIntranet</TargetZone>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>false</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+      <HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="GalaSoft.MvvmLight, Version=5.1.1.35049, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
+      <HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.1.1.35049, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
+      <HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.1.1.35053, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
+      <HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\ShareLibrary\log4net.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Windows7APICodePack-Core.1.1.0.0\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Windows7APICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL" />
+    <Reference Include="Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Compile Include="Controls\ComboBoxKeyboard.cs" />
+    <Compile Include="Controls\CustomDialog.xaml.cs">
+      <DependentUpon>CustomDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Controls\LoadingControl.xaml.cs">
+      <DependentUpon>LoadingControl.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Controls\MultiSelectComboBox.xaml.cs">
+      <DependentUpon>MultiSelectComboBox.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Controls\TextBoxKeyboard.cs" />
+    <Compile Include="Converters\BooleanToEnabledDisabledConverter.cs" />
+    <Compile Include="Converters\BooleanToVisibilityConverter.cs" />
+    <Compile Include="Converters\Category2ToTextConverter.cs" />
+    <Compile Include="Converters\CategoryCodeToTextConverter.cs" />
+    <Compile Include="Converters\StationIdToTextConverter.cs" />
+    <Compile Include="Converters\LevelIdToTextConverter.cs" />
+    <Compile Include="Converters\RankCodeToTextConverter.cs" />
+    <Compile Include="Converters\ByteToImageConverter.cs" />
+    <Compile Include="Converters\BooleanToRadioButtonConverter.cs" />
+    <Compile Include="Converters\EnumToBooleanConverter.cs" />
+    <Compile Include="Converters\IdToVisibilityConverter.cs" />
+    <Compile Include="Helpers\ShortcutHelper.cs" />
+    <Compile Include="Helpers\PasswordBoxHelper.cs" />
+    <Compile Include="Helpers\TabtipHelper.cs" />
+    <Compile Include="Cache\GlobalVar.cs" />
+    <Compile Include="Model\CustomDialogMessage.cs" />
+    <Compile Include="Model\enums\FormMode.cs" />
+    <Compile Include="Model\UserLoginMessage.cs" />
+    <Compile Include="Model\LoadingMessage.cs" />
+    <Compile Include="Model\PageItem.cs" />
+    <Compile Include="Model\PaginationConfig.cs" />
+    <Compile Include="Resources\Strings\StringProvider.cs" />
+    <Compile Include="Resources\Strings\StringResources.Designer.cs" />
+    <Compile Include="Services\INavigationService.cs" />
+    <Compile Include="Services\NavigationService.cs" />
+    <Compile Include="Validations\AlertRuleIDValidationRule.cs" />
+    <Compile Include="Validations\RequiredValidationRule.cs" />
+    <Compile Include="Validations\SelectedAlertCategoryValidationRule.cs" />
+    <Compile Include="Validations\SelectedAlertLevelValidationRule.cs" />
+    <Compile Include="ViewModel\Base\VMBase.cs" />
+    <Compile Include="ViewModel\MainViewModel.cs" />
+    <Compile Include="ViewModel\RuleFormViewModel.cs" />
+    <Compile Include="ViewModel\LoginViewModel.cs" />
+    <Compile Include="ViewModel\RuleListViewModel.cs" />
+    <Compile Include="ViewModel\ViewModelLocator.cs" />
+    <Compile Include="Views\ErrorWindow.xaml.cs">
+      <DependentUpon>ErrorWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\RuleForm.xaml.cs">
+      <DependentUpon>RuleForm.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Login.xaml.cs">
+      <DependentUpon>Login.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\DIList.xaml.cs">
+      <DependentUpon>DIList.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\RuleList.xaml.cs">
+      <DependentUpon>RuleList.xaml</DependentUpon>
+    </Compile>
+    <Page Include="Controls\CustomDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Controls\LoadingControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="Controls\MultiSelectComboBox.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\Buttons.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\Colors.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\CommonResources.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\InputElements.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\ItemsPanel.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\ItemsTemplates.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\RadioButtonStyles.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\Scroll.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\TextBlocks.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Resources\Common\TextBoxes.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\ErrorWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\RuleForm.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Login.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\DIList.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\RuleList.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\Strings\StringResources.resx">
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <None Include="packages.config" />
+    <None Include="Properties\app.manifest" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <AppDesigner Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config">
+      <SubType>Designer</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\GDNXFD.Alert.Interpreter\GDNXFD.Alert.Interpreter.csproj">
+      <Project>{2f1e40e5-0456-4fef-a2e7-51ff79118b64}</Project>
+      <Name>GDNXFD.Alert.Interpreter</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\GDNXFD.Data\GDNXFD.Data.csproj">
+      <Project>{e3a587b2-2a7a-43e7-a076-ee374ad48982}</Project>
+      <Name>GDNXFD.Data</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\logo.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\attach.png" />
+    <Resource Include="Resources\Images\back.png" />
+    <Resource Include="Resources\Images\calendar.png" />
+    <Resource Include="Resources\Images\cancel.png" />
+    <Resource Include="Resources\Images\check-big.png" />
+    <Resource Include="Resources\Images\edit.png" />
+    <Resource Include="Resources\Images\favicon.ico" />
+    <Resource Include="Resources\Images\file-delete-over.png" />
+    <Resource Include="Resources\Images\file-delete.png" />
+    <Resource Include="Resources\Images\file-download-over.png" />
+    <Resource Include="Resources\Images\file-download.png" />
+    <Resource Include="Resources\Images\icon.png" />
+    <Resource Include="Resources\Images\info.png" />
+    <Resource Include="Resources\Images\logoo.png" />
+    <Resource Include="Resources\Images\next.png" />
+    <Resource Include="Resources\Images\no_photo.png" />
+    <Resource Include="Resources\Images\refresh.png" />
+    <Resource Include="Resources\Images\search.png" />
+    <Resource Include="Resources\Images\statusApprovedWhite.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\Confirm.png" />
+    <Resource Include="Resources\Images\delete.png" />
+    <Resource Include="Resources\Images\new.png" />
+    <Resource Include="Resources\Images\view.png" />
+    <Resource Include="Resources\Images\_form.png" />
+    <Resource Include="Resources\Images\_list.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\cancel2.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\login_bg.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\user.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\new.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\refresh.jpg" />
+  </ItemGroup>
+  <ItemGroup>
+    <Resource Include="Resources\Images\query.png" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 79 - 0
GDNXFD.Alert.Config/Helpers/PasswordBoxHelper.cs

@@ -0,0 +1,79 @@
+using System.Windows;
+using System.Windows.Controls;
+namespace GDNXFD.Alert.Config.Helpers
+{
+    /// <summary>
+    /// 为PasswordBox控件的Password增加绑定功能
+    /// </summary>
+    public static class PasswordBoxHelper
+    {
+        public static readonly DependencyProperty PasswordProperty =
+            DependencyProperty.RegisterAttached("Password",
+            typeof(string), typeof(PasswordBoxHelper),
+            new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged));
+        public static readonly DependencyProperty AttachProperty =
+            DependencyProperty.RegisterAttached("Attach",
+            typeof(bool), typeof(PasswordBoxHelper), new PropertyMetadata(false, Attach));
+        private static readonly DependencyProperty IsUpdatingProperty =
+           DependencyProperty.RegisterAttached("IsUpdating", typeof(bool),
+           typeof(PasswordBoxHelper));
+
+        public static void SetAttach(DependencyObject dp, bool value)
+        {
+            dp.SetValue(AttachProperty, value);
+        }
+        public static bool GetAttach(DependencyObject dp)
+        {
+            return (bool)dp.GetValue(AttachProperty);
+        }
+        public static string GetPassword(DependencyObject dp)
+        {
+            return (string)dp.GetValue(PasswordProperty);
+        }
+        public static void SetPassword(DependencyObject dp, string value)
+        {
+            dp.SetValue(PasswordProperty, value);
+        }
+        private static bool GetIsUpdating(DependencyObject dp)
+        {
+            return (bool)dp.GetValue(IsUpdatingProperty);
+        }
+        private static void SetIsUpdating(DependencyObject dp, bool value)
+        {
+            dp.SetValue(IsUpdatingProperty, value);
+        }
+        private static void OnPasswordPropertyChanged(DependencyObject sender,
+            DependencyPropertyChangedEventArgs e)
+        {
+            PasswordBox passwordBox = sender as PasswordBox;
+            passwordBox.PasswordChanged -= PasswordChanged;
+            if (!(bool)GetIsUpdating(passwordBox))
+            {
+                passwordBox.Password = (string)e.NewValue;
+            }
+            passwordBox.PasswordChanged += PasswordChanged;
+        }
+        private static void Attach(DependencyObject sender,
+            DependencyPropertyChangedEventArgs e)
+        {
+            PasswordBox passwordBox = sender as PasswordBox;
+            if (passwordBox == null)
+                return;
+            if ((bool)e.OldValue)
+            {
+                passwordBox.PasswordChanged -= PasswordChanged;
+            }
+            if ((bool)e.NewValue)
+            {
+                passwordBox.PasswordChanged += PasswordChanged;
+            }
+        }
+        private static void PasswordChanged(object sender, RoutedEventArgs e)
+        {
+            PasswordBox passwordBox = sender as PasswordBox;
+            SetIsUpdating(passwordBox, true);
+            SetPassword(passwordBox, passwordBox.Password);
+            SetIsUpdating(passwordBox, false);
+        }
+    }
+}

+ 158 - 0
GDNXFD.Alert.Config/Helpers/ShortcutHelper.cs

@@ -0,0 +1,158 @@
+namespace GDNXFD.Alert.Config.Helpers
+{
+    using Microsoft.WindowsAPICodePack.Shell.PropertySystem;
+    using MS.WindowsAPICodePack.Internal;
+    using System;
+    using System.Diagnostics;
+    using System.IO;
+    using System.Runtime.InteropServices;
+    using System.Text;
+
+    /// <summary>
+    /// Shortcut Helper
+    /// </summary>
+    public static class ShortcutHelper
+    {
+        private static string AppId;
+
+        /// <summary>
+        /// This method creates a short cut.
+        /// </summary>
+        /// <param name="appid"></param>
+        /// <returns></returns>
+        public static bool TryCreateShortcut(string appid)
+        {
+            //var patata = System.Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
+            //Path.Combine(patata, "programs", string.Format("{0}.lnk", appid));
+            AppId = appid;
+            String shortcutPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + string.Format("\\Microsoft\\Windows\\Start Menu\\Programs\\{0}.lnk", appid);
+            if (!File.Exists(shortcutPath))
+            {
+                InstallShortcut(shortcutPath);
+                return true;
+            }
+            return false;
+        }
+
+        private static void InstallShortcut(String shortcutPath)
+        {
+            // Find the path to the current executable
+            String exePath = Process.GetCurrentProcess().MainModule.FileName;
+            var newShortcut = (IShellLinkW)new CShellLink();
+
+            // Create a shortcut to the exe
+            ErrorHelper.VerifySucceeded(newShortcut.SetPath(exePath));
+            ErrorHelper.VerifySucceeded(newShortcut.SetArguments(""));
+
+            // Open the shortcut property store, set the AppUserModelId property
+            var newShortcutProperties = (IPropertyStore)newShortcut;
+
+            using (var appId = new PropVariant(AppId))
+            {
+                ErrorHelper.VerifySucceeded(newShortcutProperties.SetValue(SystemProperties.System.AppUserModel.ID, appId));
+                ErrorHelper.VerifySucceeded(newShortcutProperties.Commit());
+            }
+
+            // Commit the shortcut to disk
+            var newShortcutSave = (IPersistFile)newShortcut;
+
+            ErrorHelper.VerifySucceeded(newShortcutSave.Save(shortcutPath, true));
+        }
+
+        internal enum STGM : long
+        {
+            STGM_READ = 0x00000000L,
+            STGM_WRITE = 0x00000001L,
+            STGM_READWRITE = 0x00000002L,
+            STGM_SHARE_DENY_NONE = 0x00000040L,
+            STGM_SHARE_DENY_READ = 0x00000030L,
+            STGM_SHARE_DENY_WRITE = 0x00000020L,
+            STGM_SHARE_EXCLUSIVE = 0x00000010L,
+            STGM_PRIORITY = 0x00040000L,
+            STGM_CREATE = 0x00001000L,
+            STGM_CONVERT = 0x00020000L,
+            STGM_FAILIFTHERE = 0x00000000L,
+            STGM_DIRECT = 0x00000000L,
+            STGM_TRANSACTED = 0x00010000L,
+            STGM_NOSCRATCH = 0x00100000L,
+            STGM_NOSNAPSHOT = 0x00200000L,
+            STGM_SIMPLE = 0x08000000L,
+            STGM_DIRECT_SWMR = 0x00400000L,
+            STGM_DELETEONRELEASE = 0x04000000L,
+        }
+
+        internal static class ShellIIDGuid
+        {
+            internal const string IShellLinkW = "000214F9-0000-0000-C000-000000000046";
+            internal const string CShellLink = "00021401-0000-0000-C000-000000000046";
+            internal const string IPersistFile = "0000010b-0000-0000-C000-000000000046";
+            internal const string IPropertyStore = "886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99";
+        }
+
+        [ComImport, Guid(ShellIIDGuid.IShellLinkW), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        internal interface IShellLinkW
+        {
+            UInt32 GetPath([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, IntPtr pfd, uint fFlags);
+            UInt32 GetIDList(out IntPtr ppidl);
+            UInt32 SetIDList(IntPtr pidl);
+            UInt32 GetDescription([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxName);
+            UInt32 SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName);
+            UInt32 GetWorkingDirectory([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath);
+            UInt32 SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);
+            UInt32 GetArguments([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath);
+            UInt32 SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs);
+            UInt32 GetHotKey(out short wHotKey);
+            UInt32 SetHotKey(short wHotKey);
+            UInt32 GetShowCmd(out uint iShowCmd);
+            UInt32 SetShowCmd(uint iShowCmd);
+            UInt32 GetIconLocation([Out(), MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pszIconPath, int cchIconPath, out int iIcon);
+            UInt32 SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon);
+            UInt32 SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, uint dwReserved);
+            UInt32 Resolve(IntPtr hwnd, uint fFlags);
+            UInt32 SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile);
+        }
+
+        [ComImport, Guid(ShellIIDGuid.IPersistFile), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        internal interface IPersistFile
+        {
+            UInt32 GetCurFile([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile);
+            UInt32 IsDirty();
+            UInt32 Load([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [MarshalAs(UnmanagedType.U4)] STGM dwMode);
+            UInt32 Save([MarshalAs(UnmanagedType.LPWStr)] string pszFileName, bool fRemember);
+            UInt32 SaveCompleted([MarshalAs(UnmanagedType.LPWStr)] string pszFileName);
+        }
+
+        [ComImport]
+        [Guid(ShellIIDGuid.IPropertyStore)]
+        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        interface IPropertyStore
+        {
+            UInt32 GetCount([Out] out uint propertyCount);
+            UInt32 GetAt([In] uint propertyIndex, out PropertyKey key);
+            UInt32 GetValue([In] ref PropertyKey key, [Out] PropVariant pv);
+            UInt32 SetValue([In] ref PropertyKey key, [In] PropVariant pv);
+            UInt32 Commit();
+        }
+
+        [ComImport, Guid(ShellIIDGuid.CShellLink), ClassInterface(ClassInterfaceType.None)]
+        internal class CShellLink { }
+
+        /// <summary>
+        /// Error Helper
+        /// </summary>
+        public static class ErrorHelper
+        {
+            /// <summary>
+            /// Verify if an operation succeeded
+            /// </summary>
+            /// <param name="hresult"></param>
+            public static void VerifySucceeded(UInt32 hresult)
+            {
+                if (hresult > 1)
+                {
+                    throw new Exception("Failed with HRESULT: " + hresult.ToString("X"));
+                }
+            }
+        }
+    }
+}

+ 126 - 0
GDNXFD.Alert.Config/Helpers/TabtipHelper.cs

@@ -0,0 +1,126 @@
+namespace GDNXFD.Alert.Config.Helpers
+{
+    using System;
+    using System.Diagnostics;
+    using System.Linq;
+    using System.Runtime.InteropServices;
+    using System.Threading;
+    using System.Threading.Tasks;
+    using System.Windows;
+    using System.Windows.Forms;
+    using System.Windows.Input;
+
+    /// <summary>
+    /// This class manages the Tabtip process (touch keyboard).
+    /// </summary>
+    public class TabtipHelper
+    {
+        private const string PROCESS_NAME = "TabTip";
+        private const string PROCESS_PATH = @"C:\Program Files\Common Files\microsoft shared\ink\tabtip.exe";
+        private Process tabtipProcess;
+        private static TabtipHelper instance;
+        private CancellationTokenSource cts;
+        private CancellationToken ct;
+        private ProcessStartInfo psi;
+
+        private TabtipHelper()
+        {
+            psi = new ProcessStartInfo
+                      {
+                          FileName = PROCESS_PATH,
+                          WindowStyle = ProcessWindowStyle.Maximized
+                      };
+        }
+
+        /// <summary>
+        /// Creates a new instance of the class.
+        /// </summary>
+        public static TabtipHelper Instance
+        {
+            get { return instance ?? (instance = new TabtipHelper()); }
+        }
+
+        /// <summary>
+        /// Is tabtip running.
+        /// </summary>
+        public bool IsTabtipRunning
+        {
+            get
+            {
+                this.tabtipProcess = Process.GetProcessesByName(PROCESS_NAME).FirstOrDefault();       
+                return (this.tabtipProcess != null);
+            }
+        }
+
+        /// <summary>
+        /// Try to kill Tabtip process.
+        /// </summary>
+        public void TryKillTabtipProcess()
+        {
+            if (IsTabtipRunning)
+            {
+                this.cts = new CancellationTokenSource();
+                this.ct = cts.Token;
+
+                // Wait for some miliseconds before hide the Taptip.
+                TaskScheduler uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();
+                Task.Factory.StartNew(async () =>
+                {
+                    await Task.Delay(TimeSpan.FromMilliseconds(100));
+                    if (!ct.IsCancellationRequested)
+                    {
+                        this.cts = null;
+                        if (!IsFullScreen())
+                        {
+                            RestoreWindow();
+                        }
+                        this.tabtipProcess.Kill();
+                    }
+                }, ct, TaskCreationOptions.None, uiScheduler);
+            }
+        }
+
+        /// <summary>
+        /// Try to create Tabtip process.
+        /// </summary>
+        public void TryCreateTabtipProcess()
+        {
+            if (IsTabtipRunning && (cts != null))
+            {
+                this.cts.Cancel();
+            }   
+ 
+            // Check if current device has touch screen.
+            if (HasTouchInput())
+            {
+                this.tabtipProcess = Process.Start(psi);
+            }
+        }
+        private bool HasTouchInput()
+        {
+            foreach (TabletDevice tabletDevice in Tablet.TabletDevices)
+            {
+                //Only detect if it is a touch Screen not how many touches (i.e. Single touch or Multi-touch)
+                if (tabletDevice.Type == TabletDeviceType.Touch)
+                    return true;
+            }
+            return false;
+        }
+        private void RestoreWindow()
+        {
+            if (App.Current.MainWindow.WindowState == WindowState.Maximized)
+            {
+                App.Current.MainWindow.UseLayoutRounding = true;
+                App.Current.MainWindow.Width = Screen.PrimaryScreen.Bounds.Width;
+                App.Current.MainWindow.Height = Screen.PrimaryScreen.Bounds.Height;
+                App.Current.MainWindow.WindowState = WindowState.Normal;
+                App.Current.MainWindow.WindowState = WindowState.Maximized;
+            }
+        }
+        private bool IsFullScreen()
+        {
+            return ((App.Current.MainWindow.Width >= Screen.PrimaryScreen.Bounds.Width)
+                && App.Current.MainWindow.Height >= Screen.PrimaryScreen.Bounds.Height);
+        }
+    }
+}

+ 12 - 0
GDNXFD.Alert.Config/MainWindow.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="GDNXFD.Alert.Config.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:GDNXFD.Alert.Config"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="350" Width="525">
+    <Grid>
+        
+    </Grid>
+</Window>

+ 28 - 0
GDNXFD.Alert.Config/MainWindow.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace GDNXFD.Alert.Config
+{
+    /// <summary>
+    /// Interaction logic for MainWindow.xaml
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 92 - 0
GDNXFD.Alert.Config/Model/CustomDialogMessage.cs

@@ -0,0 +1,92 @@
+namespace GDNXFD.Alert.Config.Model
+{
+    using GalaSoft.MvvmLight;
+    using GalaSoft.MvvmLight.Command;
+    using GDNXFD.Alert.Config.Converters;
+    using System;
+    using System.Windows;
+    using System.Windows.Input;
+
+    /// <summary>
+    /// Dialog message
+    /// </summary>
+    public class CustomDialogMessage : ObservableObject
+    {
+        private Action acceptAction;
+        private Action cancelAction;
+
+        private RelayCommand acceptCommand;
+        private RelayCommand cancelCommand;
+
+        //private TravelTypeToTextConverter travelTypeToTextConverter = new TravelTypeToTextConverter();
+        private string message;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="acceptAction">Action to be executed when pressing accept button</param>
+        /// <param name="message">Dialog message</param>
+        /// <param name="showCancel">Show or not cancel button</param>
+        public CustomDialogMessage(Action acceptAction, string message, Visibility showCancel)
+        {
+            this.acceptAction = acceptAction;
+            Message = message;
+            ShowCancel = showCancel;
+
+            this.acceptCommand = new RelayCommand(() =>
+            {
+                this.acceptAction();
+                this.cancelAction();
+            });
+        }
+
+        /// <summary>
+        /// Confirms dialog.
+        /// </summary>
+        public ICommand AcceptCommand
+        {
+            get { return this.acceptCommand; }
+        }
+
+        /// <summary>
+        /// Do nothing.
+        /// </summary>
+        public ICommand CancelCommand
+        {
+            get { return this.cancelCommand; }
+        }
+
+        /// <summary>
+        /// Action to be executed when cancel command is called.
+        /// </summary>
+        public Action CancelAction {
+            get { return this.cancelAction; }
+            set
+            {
+                this.cancelAction = value;
+                this.cancelCommand = new RelayCommand(this.cancelAction);
+            }
+        }
+
+        /// <summary>
+        /// Dialog message.
+        /// </summary>
+        public string Message
+        {
+            get
+            {
+                return this.message;
+            }
+            set
+            {
+                this.message = value;
+                RaisePropertyChanged(() => Message);
+            } 
+        }
+
+        /// <summary>
+        /// Show or not cancel button
+        /// </summary>
+        public Visibility ShowCancel { get; set; }
+    }
+}

+ 34 - 0
GDNXFD.Alert.Config/Model/LoadingMessage.cs

@@ -0,0 +1,34 @@
+namespace GDNXFD.Alert.Config.Model
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+
+    /// <summary>
+    /// Loading Message class.
+    /// </summary>
+    public class LoadingMessage
+    {
+        private bool isLoading;
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="isLoading">Is loading</param>
+        public LoadingMessage(bool isLoading)
+        {
+            this.isLoading = isLoading;
+        }
+
+        /// <summary>
+        /// Is loading property.
+        /// </summary>
+        public bool IsLoading
+        {
+            get { return this.isLoading; }
+            set { this.isLoading = value; }
+        }
+    }
+}

+ 68 - 0
GDNXFD.Alert.Config/Model/PageItem.cs

@@ -0,0 +1,68 @@
+namespace GDNXFD.Alert.Config.Model
+{
+    using System;
+
+    /// <summary>
+    /// Page item class
+    /// </summary>
+    public class PageItem
+    {
+        private string page;
+        private bool isCurrentPage;
+        private bool isClickable;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="page">Number of page</param>
+        /// <param name="isCurrentPage">Is current page</param>
+        /// <param name="isClickable">Is clickable page</param> 
+        public PageItem(string page, bool isCurrentPage, bool isClickable)
+        {
+            this.page = page;
+            this.isCurrentPage = isCurrentPage;
+            this.isClickable = isClickable;
+        }
+
+        /// <summary>
+        /// Number of page.
+        /// </summary>
+        public string Page
+        { 
+            get { return this.page; }
+            set { this.page = value; }
+        }
+
+        /// <summary>
+        /// Is current page.
+        /// </summary>
+        public bool IsCurrentPage
+        { 
+            get { return this.isCurrentPage; }
+            set
+            {
+                this.isCurrentPage = value;
+                if (value)
+                {
+                    var tmp = PageSelected;
+                    if (tmp != null)
+                        tmp(this, new EventArgs());
+                }
+            }
+        }
+
+        /// <summary>
+        /// Is clickable.
+        /// </summary>
+        public bool IsClickable
+        {
+            get { return this.isClickable; }
+            set { this.isClickable = value; }
+        }
+
+        /// <summary>
+        /// Page selected event.
+        /// </summary>
+        public event EventHandler PageSelected;
+    }
+}

+ 93 - 0
GDNXFD.Alert.Config/Model/PaginationConfig.cs

@@ -0,0 +1,93 @@
+namespace GDNXFD.Alert.Config.Model
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+
+    /// <summary>
+    /// Pagination Manager class.
+    /// </summary>
+    public class PaginationConfig
+    {
+        private PageItem pageSelected;
+        private int itemsCounted;
+        private int pageSize;
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="itemsCounted">Items counted.</param>
+        /// <param name="pageSize">Size of the page.</param>
+        public PaginationConfig(int itemsCounted, int pageSize)
+        {
+            this.itemsCounted = itemsCounted;
+            this.pageSize = pageSize;
+            this.pageSelected = new PageItem((1).ToString(), true, true);
+        }
+
+        /// <summary>
+        /// Number of pages.
+        /// </summary>
+        public int NumberOfPages
+        {
+            get { return (int)Math.Ceiling((double)this.itemsCounted / this.pageSize); }
+        }
+
+        /// <summary>
+        /// Page size.
+        /// </summary>
+        public int PageSize
+        {
+            get { return this.pageSize; }
+            set { this.pageSize = value; }
+        }
+
+        /// <summary>
+        /// Page selected.
+        /// </summary>
+        public PageItem PageSelected
+        {
+            get { return this.pageSelected; }
+            set { this.pageSelected = value; }
+        }
+
+        /// <summary>
+        /// Number of page selected.
+        /// </summary>
+        public int NumberOfPageSelected
+        {
+            get { return int.Parse(this.pageSelected.Page); }
+            set { this.pageSelected.Page = value.ToString(); }
+        }
+
+        /// <summary>
+        /// Items counted.
+        /// </summary>
+        public int ItemsCounted
+        {
+            get { return this.itemsCounted; }
+            set
+            { 
+                this.itemsCounted = value;
+            }
+        }
+
+        /// <summary>
+        /// This property is true if user can go to the next page.
+        /// </summary>
+        public bool CanGoNext
+        {
+            get { return NumberOfPageSelected < NumberOfPages; }
+        }
+
+        /// <summary>
+        /// This property is true if user can go to the previous page.
+        /// </summary>
+        public bool CanGoPrevious
+        {
+            get { return 1 < NumberOfPageSelected; }
+        }
+    }
+}

+ 34 - 0
GDNXFD.Alert.Config/Model/UserLoginMessage.cs

@@ -0,0 +1,34 @@
+namespace GDNXFD.Alert.Config.Model
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Linq;
+    using System.Text;
+    using System.Threading.Tasks;
+
+    /// <summary>
+    /// Loading Message class.
+    /// </summary>
+    public class UserLoginMessage
+    {
+        private bool isLogin;
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="isLoading">Is loading</param>
+        public UserLoginMessage(bool islogin)
+        {
+            this.isLogin = islogin;
+        }
+
+        /// <summary>
+        /// Is loading property.
+        /// </summary>
+        public bool IsLogin
+        {
+            get { return this.isLogin; }
+            set { this.isLogin = value; }
+        }
+    }
+}

+ 15 - 0
GDNXFD.Alert.Config/Model/enums/FormMode.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GDNXFD.Alert.Config
+{
+    public enum FormMode
+    {
+        ReadOnly = 0,   //浏览
+        Update = 1,     //编辑
+        Create = 2      //新建
+    }
+}

+ 55 - 0
GDNXFD.Alert.Config/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GDNXFD.Alert.Config")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("GDNXFD.Alert.Config")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set 
+//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
+//inside a <PropertyGroup>.  For example, if you are using US english
+//in your source files, set the <UICulture> to en-US.  Then uncomment
+//the NeutralResourceLanguage attribute below.  Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+                                     //(used if a resource is not found in the page, 
+                                     // or application resource dictionaries)
+    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)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
GDNXFD.Alert.Config/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace GDNXFD.Alert.Config.Properties
+{
+
+
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GDNXFD.Alert.Config.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
GDNXFD.Alert.Config/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
GDNXFD.Alert.Config/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <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.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace GDNXFD.Alert.Config.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
GDNXFD.Alert.Config/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 70 - 0
GDNXFD.Alert.Config/Properties/app.manifest

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <!-- UAC Manifest Options
+             If you want to change the Windows User Account Control level replace the 
+             requestedExecutionLevel node with one of the following.
+
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
+
+            Specifying requestedExecutionLevel element will disable file and registry virtualization. 
+            Remove this element if your application requires this virtualization for backwards
+            compatibility.
+        -->
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+      <applicationRequestMinimum>
+        <defaultAssemblyRequest permissionSetReference="Custom" />
+        <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" />
+      </applicationRequestMinimum>
+    </security>
+  </trustInfo>
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- A list of the Windows versions that this application has been tested on and is
+           is designed to work with. Uncomment the appropriate elements and Windows will 
+           automatically selected the most compatible environment. -->
+      <!-- Windows Vista -->
+      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+      <!-- Windows 7 -->
+      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+      <!-- Windows 8 -->
+      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+      <!-- Windows 8.1 -->
+      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+      <!-- Windows 10 -->
+      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+    </application>
+  </compatibility>
+  <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
+       DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need 
+       to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should 
+       also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
+  <!--
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+    </windowsSettings>
+  </application>
+  -->
+  <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
+  <!--
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity
+          type="win32"
+          name="Microsoft.Windows.Common-Controls"
+          version="6.0.0.0"
+          processorArchitecture="*"
+          publicKeyToken="6595b64144ccf1df"
+          language="*"
+        />
+    </dependentAssembly>
+  </dependency>
+  -->
+</assembly>

File diff suppressed because it is too large
+ 356 - 0
GDNXFD.Alert.Config/Resources/Common/Buttons.xaml


+ 35 - 0
GDNXFD.Alert.Config/Resources/Common/Colors.xaml

@@ -0,0 +1,35 @@
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <Color x:Key="module-primary-color">#FFFA961D</Color> 
+    <Color x:Key="module-primary-color-over">#FFC77E2C</Color> 
+    <Color x:Key="module-primary-color-dark">#FFFFEEDD</Color>
+    <Color x:Key="module-primary-color-dark-over">#FF6B4535</Color>
+    <Color x:Key="module-primary-color-light">#FFF6B05B</Color>
+    <Color x:Key="module-alternative-color">#FF9D9D9D</Color>
+    <Color x:Key="module-alternative-color-over">#FF858585</Color>
+    <Color x:Key="module-background-color">#FF7B7B7B</Color>
+    <Color x:Key="second-background-color">#FFDFE0E0</Color>
+    <Color x:Key="section-background-color">#FFFFFFFF</Color>
+    <Color x:Key="list-info-font-color">#FF2D2D2D</Color>
+    <Color x:Key="list-info-font-color-light">#FFFFFFFF</Color>
+    <Color x:Key="second-font-color">#FF9B9B9B</Color>
+    <Color x:Key="loading-darkest-color">#7FFFA500</Color>
+
+    <!--Solid color brush to apply to textblocks foreground-->
+    <SolidColorBrush x:Key="module-primary-color-brush" Color="{StaticResource module-primary-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-primary-color-over-brush" Color="{StaticResource module-primary-color-over}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-primary-color-dark-brush" Color="{StaticResource module-primary-color-dark}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-primary-color-dark-over-brush" Color="{StaticResource module-primary-color-dark-over}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-primary-color-light-brush" Color="{StaticResource module-primary-color-light}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-alternative-color-brush" Color="{StaticResource module-alternative-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-alternative-color-over-brush" Color="{StaticResource module-alternative-color-over}"></SolidColorBrush>
+    <SolidColorBrush x:Key="module-background-color-brush" Color="{StaticResource module-background-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="second-background-color-brush" Color="{StaticResource second-background-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="section-background-color-brush" Color="{StaticResource section-background-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="list-info-font-color-brush" Color="{StaticResource list-info-font-color}"></SolidColorBrush>
+    <SolidColorBrush x:Key="list-info-font-color-light-brush" Color="{StaticResource list-info-font-color-light}"></SolidColorBrush>
+    <SolidColorBrush x:Key="second-font-color-brush" Color="{StaticResource second-font-color}"></SolidColorBrush>
+
+</ResourceDictionary>

+ 15 - 0
GDNXFD.Alert.Config/Resources/Common/CommonResources.xaml

@@ -0,0 +1,15 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:converters="clr-namespace:GDNXFD.Alert.Config.Converters">
+    <converters:ByteToImageConverter x:Key="ByteToImageConverter"></converters:ByteToImageConverter>
+    <converters:EnumToBooleanConverter x:Key="EnumToBooleanConverter"></converters:EnumToBooleanConverter>
+    <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></converters:BooleanToVisibilityConverter>
+    <converters:IdToVisibilityConverter x:Key="IdToVisibilityConverter"></converters:IdToVisibilityConverter>
+
+    <converters:BooleanToRadioButtonConverter x:Key="BooleanToRadioButtonConverter"></converters:BooleanToRadioButtonConverter>
+    <converters:RankCodeToTextConverter x:Key="RankCodeToTextConverter"></converters:RankCodeToTextConverter>
+    <converters:CategoryCodeToTextConverter x:Key="CategoryCodeToTextConverter"></converters:CategoryCodeToTextConverter>
+
+
+
+</ResourceDictionary>

+ 107 - 0
GDNXFD.Alert.Config/Resources/Common/InputElements.xaml

@@ -0,0 +1,107 @@
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="/Resources/Common/Colors.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+
+    <Style x:Key="InputElement" TargetType="Control">
+        <Setter Property="FontFamily" Value="微软雅黑" />
+        <Setter Property="FontSize" Value="14" />
+        <Setter Property="Height" Value="22" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Padding" Value="1" />
+    </Style>
+    <Style x:Key="TextBox" TargetType="TextBox" BasedOn="{StaticResource InputElement}">
+        <Setter Property="MaxLength" Value="150"></Setter>
+        <Style.Triggers>
+            <Trigger Property="Validation.HasError" Value="true">
+                <Setter Property="ToolTip"
+                        Value="{Binding RelativeSource={x:Static RelativeSource.Self},
+                    Path=(Validation.Errors)[0].ErrorContent}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    <Style TargetType="DatePickerTextBox" BasedOn="{StaticResource InputElement}">
+        <Setter Property="IsReadOnly" Value="True"/>
+    </Style>
+    <Style TargetType="DatePicker" BasedOn="{StaticResource InputElement}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type DatePicker}">
+                    <Grid x:Name="PART_Root">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*" />
+                            <ColumnDefinition Width="Auto" />
+                        </Grid.ColumnDefinitions>
+                        <DatePickerTextBox x:Name="PART_TextBox"
+                                       BorderBrush="{TemplateBinding BorderBrush}"
+                                       BorderThickness="{TemplateBinding BorderThickness}"
+                                       HorizontalContentAlignment="Stretch"
+                                       Padding="{TemplateBinding Padding}"
+                                       VerticalContentAlignment="Center"
+                                       Visibility="Visible"
+                                       Grid.Column="0">
+                        </DatePickerTextBox>
+                        <Button x:Name="PART_Button">
+                            <Button.Style>
+                                <Style TargetType="{x:Type Button}">
+                                    <Setter Property="Template">
+                                        <Setter.Value>
+                                            <ControlTemplate TargetType="{x:Type Button}">
+                                                <Button x:Name="PART_Button" VerticalAlignment="Stretch">
+                                                    <Button.Style>
+                                                        <Style TargetType="{x:Type Button}">
+                                                            <Setter Property="OverridesDefaultStyle" Value="True"></Setter>
+                                                            <Setter Property="Template">
+                                                                <Setter.Value>
+                                                                    <ControlTemplate TargetType="{x:Type Button}">
+                                                                        <Border Background="{StaticResource module-primary-color-brush}"
+                                                                            Height="Auto" 
+                                                                            HorizontalAlignment="Right"
+                                                                            Width="{Binding Path=Height, RelativeSource={RelativeSource Mode=Self}}"
+                                                                            Padding="4,0,4,0"
+                                                                            >
+                                                                            <Image Name="buttonImage"
+                                                                                Source="../resources/images/calendar.png"
+                                                                                Stretch="None"
+                                                                                VerticalAlignment="Center">
+                                                                            </Image>
+                                                                        </Border>
+                                                                    </ControlTemplate>
+                                                                </Setter.Value>
+                                                            </Setter>
+                                                        </Style>
+                                                    </Button.Style>
+                                                </Button>
+                                            </ControlTemplate>
+                                        </Setter.Value>
+                                    </Setter>
+                                </Style>
+                            </Button.Style>
+                        </Button>
+                        <Popup x:Name="PART_Popup" StaysOpen="False" AllowsTransparency="True" />
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+
+    <Style x:Key="ComboBox" TargetType="ComboBox" BasedOn="{StaticResource InputElement}">
+    </Style>
+    <Style x:Key="TextArea" TargetType="TextBox" BasedOn="{StaticResource InputElement}">
+        <Setter Property="Height" Value="80"/>
+        <Setter Property="TextWrapping" Value="Wrap"/>
+        <Setter Property="AcceptsReturn" Value="True"/>
+        <Setter Property="Padding" Value="3" />
+        <Setter Property="VerticalContentAlignment" Value="Top" />
+        <Setter Property="MaxLength" Value="1500"></Setter>
+    </Style>
+
+    <Style x:Key="PasswordBox" TargetType="PasswordBox" BasedOn="{StaticResource InputElement}">
+        <Setter Property="MaxLength" Value="150"></Setter>
+    </Style>
+
+</ResourceDictionary>

+ 6 - 0
GDNXFD.Alert.Config/Resources/Common/ItemsPanel.xaml

@@ -0,0 +1,6 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <ItemsPanelTemplate x:Key="HorizontalItemsPanel">
+        <StackPanel Orientation="Horizontal"/>
+    </ItemsPanelTemplate>
+</ResourceDictionary>

+ 153 - 0
GDNXFD.Alert.Config/Resources/Common/ItemsTemplates.xaml

@@ -0,0 +1,153 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:resx="clr-namespace:GDNXFD.Alert.Config.Resources.Strings">
+
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="/Resources/Common/CommonResources.xaml"/>
+        <ResourceDictionary Source="/Resources/Common/RadioButtonStyles.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    <ObjectDataProvider x:Key="Provider" ObjectType="{x:Type resx:StringProvider}" MethodName="GetResourceInstance"></ObjectDataProvider>
+
+    <DataTemplate x:Key="ListRulesTemplate">
+        <Grid Height="70" HorizontalAlignment="Stretch" Margin="0,0,0,5">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="70"></ColumnDefinition>
+                <ColumnDefinition Width="150"></ColumnDefinition>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="70"></ColumnDefinition>
+                <ColumnDefinition Width="70"></ColumnDefinition>
+                <ColumnDefinition Width="70"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+<!--
+            <Image Source="{Binding EmployeePhoto, Converter={StaticResource ByteToImageConverter}}" Margin="0,0,5,0"
+                   Width="auto" Height="auto" Grid.Column="0" Stretch="UniformToFill"></Image>
+-->
+            <Border Background="{StaticResource module-primary-color-over-brush}" Grid.Column="0" Margin="0,0,5,0">
+                <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis" HorizontalAlignment="Center" VerticalAlignment="Center">
+                    <Run Style="{StaticResource ListTextBigLight}" Text="{Binding Id}"></Run>
+                </TextBlock>
+            </Border>
+            
+            <Border Background="{StaticResource module-primary-color-light-brush}" Grid.Column="1" Margin="0,0,5,0"
+                    Padding="15,10,5,5">
+                <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
+                    <Run Style="{StaticResource ListTextBigLight}" Text="{Binding Name}"></Run>
+                    <LineBreak></LineBreak>
+                    <Run Style="{StaticResource ListTextSmallLight}" Text="{Binding Rank}"></Run>
+                </TextBlock>
+            </Border>
+
+            <Border Background="{StaticResource second-background-color-brush}" Grid.Column="2"
+                    Padding="15,10,5,5">
+                <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
+                    <Run Style="{StaticResource ListTextBigDark}"  Text="{Binding Expression}"></Run>
+                </TextBlock>
+            </Border>
+
+            <Border Background="{StaticResource second-background-color-brush}" Grid.Column="3" Margin="0,0,5,0"
+                    Padding="15,10,5,5">
+                <TextBlock TextWrapping="NoWrap" TextTrimming="WordEllipsis">
+                    <Run Style="{StaticResource ListTextBigDark}"  Text="{Binding Description}"></Run>
+                    <LineBreak></LineBreak>
+                  <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Tag}"></Run>
+                </TextBlock>
+            </Border>
+
+            <Button CommandParameter="{Binding}" Margin="0,0,5,0"
+                    ToolTip="{Binding Edit, Source={StaticResource Provider}, Mode=OneWay}"
+                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.EditRuleCommand }"
+                    Style="{StaticResource PrimaryColorButtonStyle}"
+                    Grid.Column="4">
+                <Button.Content>
+                    <Image Source="/Resources/Images/edit.png" Width="21" Height="21"></Image>
+                </Button.Content>
+            </Button>
+
+            <Button CommandParameter="{Binding}" Style="{StaticResource PrimaryColorDarkButtonStyle}" Grid.Column="5" Margin="0,0,5,0"
+                    ToolTip="{Binding Complete, Source={StaticResource Provider}, Mode=OneWay}"
+                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.ViewRuleCommand}">
+                <Button.Content>
+                    <Image Source="/Resources/Images/statusApprovedWhite.png" Width="20" Height="16"></Image>
+                </Button.Content>
+            </Button>
+
+            <Button CommandParameter="{Binding Id}" Style="{StaticResource AlternativeColorButtonStyle}" Grid.Column="6"
+                    ToolTip="{Binding Remove, Source={StaticResource Provider}, Mode=OneWay}"
+                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.RemoveRuleCommand}">
+                <Button.Content>
+                    <Image Source="/Resources/Images/cancel.png" Width="18" Height="18"></Image>
+                </Button.Content>
+
+            </Button>
+        </Grid>
+    </DataTemplate>
+    
+    <DataTemplate x:Key="ListPagesTemplate">
+        <RadioButton Content="{Binding Page}" IsChecked="{Binding IsCurrentPage, Mode=TwoWay}" IsEnabled="{Binding IsClickable}"
+                     GroupName="Pages" Template="{StaticResource RadioButtonNumberOfPage}"></RadioButton>
+    </DataTemplate>
+
+    <DataTemplate x:Key="AttachmentsTemplate">
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition Width="50"></ColumnDefinition>
+                <ColumnDefinition Width="50"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <TextBlock Grid.Column="0" VerticalAlignment="Center" >
+                <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Name}"></Run>
+            </TextBlock>
+            <Button  Visibility="{Binding TravelAttachmentId, Converter={StaticResource IdToVisibilityConverter}}" Grid.Column="1" 
+                     ToolTip="{Binding DownloadAttachment, Source={StaticResource Provider}, Mode=OneWay}"
+                     CommandParameter="{Binding}"
+                     Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.DownloadAttachmentCommand}"
+                     Style="{StaticResource TransparentButtonStyle}">
+                <Image Stretch="None" Source="/Resources/Images/file-download.png" ></Image>
+            </Button>
+            <Button Grid.Column="2" Style="{StaticResource TransparentButtonStyle}" Height="50"
+                    ToolTip="{Binding RemoveAttachment, Source={StaticResource Provider}, Mode=OneWay}"
+                    CommandParameter="{Binding}"
+                    Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, Path=DataContext.RemoveAttachmentCommand}">
+                <Image Stretch="None" Source="/Resources/Images/file-delete.png" ></Image>
+            </Button>
+        </Grid>
+    </DataTemplate>
+
+    <DataTemplate x:Key="TestingPointTemplate">
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Name="名称"></ColumnDefinition>
+                <ColumnDefinition Name="编码"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <TextBlock Grid.Column="0" VerticalAlignment="Center" >
+                <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding UniformCode}"></Run>
+            </TextBlock>
+            <TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="15 0 0 0" >
+                <Run Style="{StaticResource ListTextSmallDark}" Text="{Binding Name}"></Run>
+            </TextBlock>
+        </Grid>
+    </DataTemplate>
+
+    <Style x:Key="AlternativeColorItemStyle" TargetType="ListBoxItem" >
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ListBoxItem}">
+                    <Border x:Name="bdr_main" Background="{StaticResource  module-alternative-color-brush}">
+                        <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content" />
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="bdr_main" Property="Background" Value="{StaticResource  module-alternative-color-over-brush}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Margin" Value="2 2 2 2"/>
+        <Setter Property="MaxHeight" Value="30" />
+        <Setter Property="FontSize" Value="16"/>
+        <Setter Property="FontWeight" Value="Bold"/>
+        <Setter Property="Foreground" Value="{StaticResource list-info-font-color-light-brush}"/>
+    </Style>
+</ResourceDictionary>

+ 46 - 0
GDNXFD.Alert.Config/Resources/Common/RadioButtonStyles.xaml

@@ -0,0 +1,46 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="/Resources/Common/TextBlocks.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    
+    <Style x:Key="FormRadios" TargetType="RadioButton">
+        <Setter Property="FontSize" Value="14"></Setter>
+        <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
+    </Style>
+
+    <Style x:Key="FormBorderStyle" TargetType="Border">
+        <Setter Property="Margin" Value="0 5 0 0"></Setter>
+        <Setter Property="Padding" Value="5"></Setter>
+        <Setter Property="CornerRadius" Value="5"></Setter>
+        <Setter Property="BorderBrush" Value="Gray"></Setter>
+        <Setter Property="BorderThickness" Value="1"></Setter>
+    </Style>
+
+    <ControlTemplate x:Key="RadioButtonNumberOfPage" TargetType="RadioButton">
+        <Grid Width="Auto" Margin="12,0" Background="#00000000" Cursor="Hand">
+            <VisualStateManager.VisualStateGroups>
+                <VisualStateGroup x:Name="CheckStates">
+                    <VisualState x:Name="Checked">
+                        <Storyboard>
+                            <DoubleAnimation Storyboard.TargetName="SelectedText" Storyboard.TargetProperty="(UIElement.Opacity)" 
+                                             Duration="0:0:0.100" To="1"/>
+                            <DoubleAnimation Storyboard.TargetName="OriginalText" Storyboard.TargetProperty="(UIElement.Opacity)" 
+                                             Duration="0:0:0.100" To="0"/>
+                        </Storyboard>
+                    </VisualState>
+                    <VisualState x:Name="Unchecked"/>
+                </VisualStateGroup>
+            </VisualStateManager.VisualStateGroups>
+            <ContentPresenter Name="Container" Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed"/>
+            <TextBlock Name="OriginalText" Style="{StaticResource NumberOfPageText}" Text="{Binding Content, ElementName=Container}" Visibility="Visible" Opacity="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+            <TextBlock Name="SelectedText" Style="{StaticResource NumberOfSelectedPageText}" Text="{Binding Content, ElementName=Container}" Visibility="Visible" Opacity="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+        </Grid>
+        <ControlTemplate.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter TargetName="OriginalText" Property="Style" Value="{StaticResource NumberOfPageMouseHoverText}"/>
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+</ResourceDictionary>

+ 218 - 0
GDNXFD.Alert.Config/Resources/Common/Scroll.xaml

@@ -0,0 +1,218 @@
+
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="/Resources/Common/Colors.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    
+        <Style x:Key="ScrollBarLineButton"
+       TargetType="{x:Type RepeatButton}">
+            <Setter Property="SnapsToDevicePixels"
+          Value="True" />
+            <Setter Property="OverridesDefaultStyle"
+          Value="true" />
+            <Setter Property="Focusable"
+          Value="false" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type RepeatButton}">
+                        <Border x:Name="Border"
+                Margin="1"
+                CornerRadius="2"
+                BorderThickness="1">
+                            <Border.BorderBrush>
+                                <LinearGradientBrush StartPoint="0,0"
+                                 EndPoint="0,1">
+                                    <LinearGradientBrush.GradientStops>
+                                        <GradientStopCollection>
+                                            <GradientStop Color="{DynamicResource BorderMediumColor}"
+                                Offset="0.0" />
+                                            <GradientStop Color="{DynamicResource BorderDarkColor}"
+                                Offset="1.0" />
+                                        </GradientStopCollection>
+                                    </LinearGradientBrush.GradientStops>
+                                </LinearGradientBrush>
+                            </Border.BorderBrush>
+                            <Border.Background>
+                                <LinearGradientBrush StartPoint="0,0"
+                                 EndPoint="0,1">
+                                    <LinearGradientBrush.GradientStops>
+                                        <GradientStopCollection>
+                                            <GradientStop Color="{DynamicResource ControlLightColor}"/>
+                                            <GradientStop Color="{DynamicResource ControlMediumColor}"
+                                Offset="1.0" />
+                                        </GradientStopCollection>
+                                    </LinearGradientBrush.GradientStops>
+                                </LinearGradientBrush>
+                            </Border.Background>
+                            <VisualStateManager.VisualStateGroups>
+                                <VisualStateGroup x:Name="CommonStates">
+                                    <VisualState x:Name="Normal" />
+                                    <VisualState x:Name="MouseOver" />
+                                    <VisualState x:Name="Pressed">
+                                        <Storyboard>
+                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
+                                                Storyboard.TargetProperty="(Panel.Background).
+                    (GradientBrush.GradientStops)[1].(GradientStop.Color)">
+                                                <EasingColorKeyFrame KeyTime="0"
+                                         Value="Blue" />
+                                            </ColorAnimationUsingKeyFrames>
+                                        </Storyboard>
+                                    </VisualState>
+                                    <VisualState x:Name="Disabled">
+                                        <Storyboard>
+                                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="Arrow"
+                                                Storyboard.TargetProperty="(Shape.Fill).
+                    (SolidColorBrush.Color)">
+                                                <EasingColorKeyFrame KeyTime="0"
+                                         Value="Blue" />
+                                            </ColorAnimationUsingKeyFrames>
+                                        </Storyboard>
+                                    </VisualState>
+                                </VisualStateGroup>
+                            </VisualStateManager.VisualStateGroups>
+                            <Path x:Name="Arrow"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Center"
+                Data="{Binding Content, 
+            RelativeSource={RelativeSource TemplatedParent}}" >
+                                <Path.Fill>
+                                    <SolidColorBrush Color="{DynamicResource GlyphColor}"/>
+                                </Path.Fill>
+                            </Path>
+                        </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <Style x:Key="ScrollBarPageButton"
+       TargetType="{x:Type RepeatButton}">
+            <Setter Property="SnapsToDevicePixels"
+          Value="True" />
+            <Setter Property="OverridesDefaultStyle"
+          Value="true" />
+            <Setter Property="IsTabStop"
+          Value="false" />
+            <Setter Property="Focusable"
+          Value="false" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type RepeatButton}">
+                        <Border Background="Transparent" />
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <Style x:Key="ScrollBarThumb"
+       TargetType="{x:Type Thumb}">
+            <Setter Property="SnapsToDevicePixels"
+          Value="True" />
+            <Setter Property="OverridesDefaultStyle"
+          Value="true" />
+            <Setter Property="IsTabStop"
+          Value="false" />
+            <Setter Property="Focusable"
+          Value="false" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Thumb}">
+                        <Grid Background="#00FFFFFF" IsHitTestVisible="True" Margin="-10">
+                            <Border CornerRadius="3" Margin="10"
+                Background="{StaticResource module-primary-color-brush}"
+                BorderThickness="0" />
+                        </Grid>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+
+        <ControlTemplate x:Key="VerticalScrollBar"
+                 TargetType="{x:Type ScrollBar}">
+            <Grid Background="#00FF0000" Margin="0,5,0,5">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="*" />
+                </Grid.RowDefinitions>
+                <Border Grid.RowSpan="3"
+            CornerRadius="3"
+            Background="#000000" />
+                <Track x:Name="PART_Track"
+           Grid.Row="1" 
+           IsDirectionReversed="true">
+                    <Track.DecreaseRepeatButton>
+                        <RepeatButton Style="{StaticResource ScrollBarPageButton}"
+                      Command="ScrollBar.PageUpCommand" />
+                    </Track.DecreaseRepeatButton>
+                    <Track.Thumb>
+                        <Thumb Style="{StaticResource ScrollBarThumb}">
+                        </Thumb>
+                    </Track.Thumb>
+                    <Track.IncreaseRepeatButton>
+                        <RepeatButton Style="{StaticResource ScrollBarPageButton}"
+                      Command="ScrollBar.PageDownCommand" />
+                    </Track.IncreaseRepeatButton>
+                </Track>
+            </Grid>
+        </ControlTemplate>
+
+        <ControlTemplate x:Key="HorizontalScrollBar"
+                 TargetType="{x:Type ScrollBar}">
+            <Grid Background="#00FF0000" Margin="5,0,5,0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
+                <Border Grid.ColumnSpan="3"
+            CornerRadius="3"
+            Background="#F0F0F0" />
+                <Track x:Name="PART_Track"
+           Grid.Column="1"
+           IsDirectionReversed="False">
+                    <Track.DecreaseRepeatButton>
+                        <RepeatButton Style="{StaticResource ScrollBarPageButton}"
+                      Command="ScrollBar.PageLeftCommand" />
+                    </Track.DecreaseRepeatButton>
+                    <Track.Thumb>
+                        <Thumb Style="{StaticResource ScrollBarThumb}">
+                        </Thumb>
+                    </Track.Thumb>
+                    <Track.IncreaseRepeatButton>
+                        <RepeatButton Style="{StaticResource ScrollBarPageButton}"
+                      Command="ScrollBar.PageRightCommand" />
+                    </Track.IncreaseRepeatButton>
+                </Track>
+            </Grid>
+        </ControlTemplate>
+
+        <Style x:Key="{x:Type ScrollBar}"
+       TargetType="{x:Type ScrollBar}">
+            <Setter Property="SnapsToDevicePixels"
+          Value="True" />
+            <Setter Property="OverridesDefaultStyle"
+          Value="true" />
+            <Style.Triggers>
+                <Trigger Property="Orientation"
+             Value="Horizontal">
+                    <Setter Property="Width"
+              Value="Auto" />
+                    <Setter Property="Height"
+              Value="6" />
+                    <Setter Property="Template"
+              Value="{StaticResource HorizontalScrollBar}" />
+                </Trigger>
+                <Trigger Property="Orientation"
+             Value="Vertical">
+                    <Setter Property="Width"
+              Value="6" />
+                    <Setter Property="Height"
+              Value="Auto" />
+                    <Setter Property="Template"
+              Value="{StaticResource VerticalScrollBar}" />
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+
+
+
+</ResourceDictionary>

+ 117 - 0
GDNXFD.Alert.Config/Resources/Common/TextBlocks.xaml

@@ -0,0 +1,117 @@
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="/Resources/Common/Colors.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+
+    <Style x:Key="BasicTextBlockStyle" TargetType="TextBlock">
+        <Setter Property="FontFamily" Value="微软雅黑"/>
+        <Setter Property="FontWeight" Value="Normal"></Setter>
+    </Style>
+    <Style x:Key="FormTitleStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextBlockStyle}">
+        <Setter Property="Margin" Value="21,0,0,0"></Setter>
+        <Setter Property="VerticalAlignment" Value="Center"></Setter>
+        <Setter Property="FontSize" Value="14"/>
+        <Setter Property="Foreground" Value="Black" />
+    </Style>
+    <Style x:Key="ButtonLabelStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextBlockStyle}">
+        <Setter Property="VerticalAlignment" Value="Center"></Setter>
+        <Setter Property="FontSize" Value="15"/>
+        <Setter Property="Foreground" Value="White" />
+    </Style>
+    <Style x:Key="MessagesTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextBlockStyle}">
+        <Setter Property="FontSize" Value="18"/>
+    </Style>
+    <Style x:Key="RightText" TargetType="TextBlock" BasedOn="{StaticResource BasicTextBlockStyle}">
+        <Setter Property="FontSize" Value="12"/>
+        <Setter Property="Margin" Value="0, 0, 0, 0"/>
+        <Setter Property="VerticalAlignment" Value="Center"/>
+        <Setter Property="HorizontalAlignment" Value="Right"></Setter>
+    </Style>
+    <Style x:Key="UserNameStyle" TargetType="TextBlock" BasedOn="{StaticResource RightText}">
+        <Setter Property="Foreground" Value="{StaticResource module-primary-color-dark-brush}"/>
+    </Style>
+    <Style x:Key="LoginStyle" TargetType="TextBlock" BasedOn="{StaticResource RightText}">
+        <Setter Property="Foreground" Value="#0085b2"/>
+        <Setter Property="FontSize" Value="15"/>
+    </Style>
+    <Style x:Key="RightTextPrimaryColor" TargetType="TextBlock" BasedOn="{StaticResource RightText}">
+        <Setter Property="Foreground" Value="Black" />
+        <Setter Property="HorizontalAlignment" Value="Left"></Setter>
+    </Style>
+    <Style x:Key="HugeTextPrimaryColor" TargetType="TextBlock" BasedOn="{StaticResource RightText}">
+        <Setter Property="Foreground" Value="Red"/>
+        <Setter Property="FontSize" Value="16"/>
+        <Setter Property="HorizontalAlignment" Value="Center"></Setter>
+        <Setter Property="VerticalAlignment" Value="Center" ></Setter>
+        <Setter Property="Margin" Value="10, 0, 10, 0"></Setter>
+    </Style>
+    <Style x:Key="LabelStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextBlockStyle}">
+        <Setter Property="Foreground" Value="{StaticResource second-font-color-brush}"/>
+        <Setter Property="FontSize" Value="13"/>
+        <Setter Property="Margin" Value="0"/>
+    </Style>
+
+    <Style x:Key="LoginButtonText" TargetType="Run">
+        <Setter Property="Foreground" Value="{StaticResource list-info-font-color-light-brush}"/>
+        <Setter Property="FontSize" Value="15"/>
+        <Setter Property="FontFamily" Value="微软雅黑"/>
+        <Setter Property="FontWeight" Value="Normal"></Setter>
+    </Style>
+    <!-- List texts -->
+    <Style x:Key="ListTextBigLight" TargetType="Run">
+        <Setter Property="Foreground" Value="{StaticResource list-info-font-color-light-brush}"/>
+        <Setter Property="FontSize" Value="18"/>
+        <Setter Property="FontFamily" Value="微软雅黑"/>
+        <Setter Property="FontWeight" Value="Normal"></Setter>
+    </Style>
+    <Style x:Key="ListTextSmallLight" TargetType="Run" BasedOn="{StaticResource ListTextBigLight}">
+        <Setter Property="FontSize" Value="14"/>
+    </Style>
+    <Style x:Key="ListTextBigDark" TargetType="Run" BasedOn="{StaticResource ListTextBigLight}">
+        <Setter Property="Foreground" Value="{StaticResource list-info-font-color-brush}"/>
+    </Style>
+    <Style x:Key="ListTextSmallDark" TargetType="Run" BasedOn="{StaticResource ListTextBigDark}">
+        <Setter Property="FontSize" Value="14"/>
+    </Style>
+    <Style x:Key="Title" TargetType="Run" BasedOn="{StaticResource ListTextBigLight}">
+        <Setter Property="Foreground" Value="{StaticResource module-primary-color-dark-brush}"/>
+        <Setter Property="FontFamily" Value="微软雅黑"/>
+        <Setter Property="FontSize" Value="18"/>
+    </Style>
+    
+    <!--Pagination texts-->
+    <Style x:Key="NumberOfPageText" TargetType="TextBlock">
+        <Setter Property="Foreground" Value="{StaticResource  module-alternative-color-brush}"/>
+        <Setter Property="FontSize" Value="12"/>
+        <Setter Property="FontWeight" Value="SemiBold"/>
+    </Style>
+    <Style x:Key="NumberOfPageMouseHoverText" TargetType="TextBlock">
+        <Setter Property="Foreground" Value="{StaticResource  module-alternative-color-brush}"/>
+        <Setter Property="FontSize" Value="15"/>
+        <Setter Property="FontWeight" Value="SemiBold"/>
+    </Style>
+    <Style x:Key="NumberOfSelectedPageText" TargetType="TextBlock">
+        <Setter Property="Foreground" Value="{StaticResource module-primary-color-brush}"/>
+        <Setter Property="FontSize" Value="15"/>
+        <Setter Property="FontWeight" Value="SemiBold"/>
+    </Style>
+
+    <Style x:Key="DataGridCellCenterStyle"  TargetType="{x:Type TextBlock}">
+        <Setter Property="HorizontalAlignment" Value="Center" />
+        <Setter Property="VerticalAlignment" Value="Center" />
+    </Style>
+
+    <Style x:Key="CheckBoxCellCenterStyle"  TargetType="{x:Type CheckBox}">
+        <Setter Property="HorizontalAlignment" Value="Center" />
+        <Setter Property="VerticalAlignment" Value="Center" />
+    </Style>
+
+    <Style x:Key="ComboCellCenterStyle"  TargetType="{x:Type ComboBox}">
+        <Setter Property="HorizontalAlignment" Value="Center" />
+        <Setter Property="VerticalAlignment" Value="Center" />
+    </Style>
+
+</ResourceDictionary>

+ 27 - 0
GDNXFD.Alert.Config/Resources/Common/TextBoxes.xaml

@@ -0,0 +1,27 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <ControlTemplate x:Key="SearchTextBoxTemplate" TargetType="{x:Type TextBoxBase}">
+        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="*"></ColumnDefinition>
+                    <ColumnDefinition Width="36"></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <ScrollViewer Grid.Column="0" x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
+                <Image Grid.Column="1" Source="/Resources/Images/search.png" Margin="5 2 5 2"></Image>
+            </Grid>
+        </Border>
+        <ControlTemplate.Triggers>
+            <Trigger Property="IsEnabled" Value="False">
+                <Setter Property="Opacity" TargetName="border" Value="0.56"/>
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
+            </Trigger>
+            <Trigger Property="IsKeyboardFocused" Value="True">
+                <Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+</ResourceDictionary>

BIN
GDNXFD.Alert.Config/Resources/Images/Confirm.png


BIN
GDNXFD.Alert.Config/Resources/Images/_form.png


BIN
GDNXFD.Alert.Config/Resources/Images/_list.png


BIN
GDNXFD.Alert.Config/Resources/Images/attach.png


BIN
GDNXFD.Alert.Config/Resources/Images/back.png


BIN
GDNXFD.Alert.Config/Resources/Images/calendar.png


BIN
GDNXFD.Alert.Config/Resources/Images/cancel.png


BIN
GDNXFD.Alert.Config/Resources/Images/cancel2.png


BIN
GDNXFD.Alert.Config/Resources/Images/check-big.png


BIN
GDNXFD.Alert.Config/Resources/Images/delete.png


BIN
GDNXFD.Alert.Config/Resources/Images/edit.png


BIN
GDNXFD.Alert.Config/Resources/Images/favicon.ico


BIN
GDNXFD.Alert.Config/Resources/Images/favicon_old.ico


BIN
GDNXFD.Alert.Config/Resources/Images/file-delete-over.png


BIN
GDNXFD.Alert.Config/Resources/Images/file-delete.png


+ 0 - 0
GDNXFD.Alert.Config/Resources/Images/file-download-over.png


Some files were not shown because too many files changed in this diff