Browse Source

初始代码提交

master
王瑞 9 months ago
commit
cb4b145a0b
  1. 2
      Code/.gitignore
  2. 2
      Code/CameraErrorCheck/.gitignore
  3. 16
      Code/CameraErrorCheck/App.config
  4. 99
      Code/CameraErrorCheck/CameraErrorCheck.csproj
  5. 43
      Code/CameraErrorCheck/CameraInfoMo.cs
  6. 147
      Code/CameraErrorCheck/CameraMySqlHelp.cs
  7. 163
      Code/CameraErrorCheck/Form1.Designer.cs
  8. 363
      Code/CameraErrorCheck/Form1.cs
  9. 127
      Code/CameraErrorCheck/Form1.resx
  10. 92
      Code/CameraErrorCheck/MyFileLogHelper.cs
  11. 22
      Code/CameraErrorCheck/Program.cs
  12. 36
      Code/CameraErrorCheck/Properties/AssemblyInfo.cs
  13. 70
      Code/CameraErrorCheck/Properties/Resources.Designer.cs
  14. 117
      Code/CameraErrorCheck/Properties/Resources.resx
  15. 29
      Code/CameraErrorCheck/Properties/Settings.Designer.cs
  16. 7
      Code/CameraErrorCheck/Properties/Settings.settings
  17. 6
      Code/CameraErrorCheck/packages.config
  18. 1
      Code/ClassLib/.gitignore
  19. 2
      Code/ClassLib/RoadFlow/LitJSON/.gitignore
  20. 60
      Code/ClassLib/RoadFlow/LitJSON/IJsonWrapper.cs
  21. 1007
      Code/ClassLib/RoadFlow/LitJSON/JsonData.cs
  22. 60
      Code/ClassLib/RoadFlow/LitJSON/JsonException.cs
  23. 925
      Code/ClassLib/RoadFlow/LitJSON/JsonMapper.cs
  24. 105
      Code/ClassLib/RoadFlow/LitJSON/JsonMockWrapper.cs
  25. 464
      Code/ClassLib/RoadFlow/LitJSON/JsonReader.cs
  26. 463
      Code/ClassLib/RoadFlow/LitJSON/JsonWriter.cs
  27. 912
      Code/ClassLib/RoadFlow/LitJSON/Lexer.cs
  28. 73
      Code/ClassLib/RoadFlow/LitJSON/LitJSON.csproj
  29. 44
      Code/ClassLib/RoadFlow/LitJSON/ParserToken.cs
  30. 36
      Code/ClassLib/RoadFlow/LitJSON/Properties/AssemblyInfo.cs
  31. 2
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/.gitignore
  32. 15
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/Cache.cs
  33. 36
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/Properties/AssemblyInfo.cs
  34. 77
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/RoadFlow.Cache.Factory.csproj
  35. 2
      Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/.gitignore
  36. 77
      Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/Cache.cs
  37. 36
      Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/Properties/AssemblyInfo.cs
  38. 77
      Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/RoadFlow.Cache.IO.csproj
  39. 2
      Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/.gitignore
  40. 82
      Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/Cache.cs
  41. 36
      Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/Properties/AssemblyInfo.cs
  42. 74
      Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/RoadFlow.Cache.InProc.csproj
  43. 2
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/.gitignore
  44. 42
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/ICache.cs
  45. 36
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/Properties/AssemblyInfo.cs
  46. 67
      Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/RoadFlow.Cache.Interface.csproj
  47. 2
      Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/.gitignore
  48. 255
      Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/Factory.cs
  49. 36
      Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/Properties/AssemblyInfo.cs
  50. 103
      Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/RoadFlow.Data.Factory.csproj
  51. 15
      Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/app.config
  52. 2
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/.gitignore
  53. 54
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IAppLibrary.cs
  54. 38
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IDBConnection.cs
  55. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IDictionary.cs
  56. 54
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/ILog.cs
  57. 79
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IOrganize.cs
  58. 38
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IRole.cs
  59. 90
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IRoleApp.cs
  60. 78
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsers.cs
  61. 58
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersApp.cs
  62. 38
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersInfo.cs
  63. 74
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersRelation.cs
  64. 58
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersRole.cs
  65. 53
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlow.cs
  66. 48
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowArchives.cs
  67. 43
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowButtons.cs
  68. 55
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowComment.cs
  69. 43
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowData.cs
  70. 59
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowDelegation.cs
  71. 43
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowForm.cs
  72. 235
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowTask.cs
  73. 38
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkGroup.cs
  74. 36
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/Properties/AssemblyInfo.cs
  75. 92
      Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/RoadFlow.Data.Interface.csproj
  76. 2
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/.gitignore
  77. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/AppLibrary.cs
  78. 41
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/DBConnection.cs
  79. 59
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Dictionary.cs
  80. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Log.cs
  81. 47
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/OnlineUsers.cs
  82. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Organize.cs
  83. 36
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Properties/AssemblyInfo.cs
  84. 96
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/RoadFlow.Data.Model.csproj
  85. 35
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Role.cs
  86. 65
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/RoleApp.cs
  87. 53
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Users.cs
  88. 65
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersApp.cs
  89. 65
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersInfo.cs
  90. 35
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersRelation.cs
  91. 29
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersRole.cs
  92. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlow.cs
  93. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowArchives.cs
  94. 47
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowButtons.cs
  95. 41
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowComment.cs
  96. 25
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowCustomEventParams.cs
  97. 47
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowData.cs
  98. 59
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowDelegation.cs
  99. 83
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowForm.cs
  100. 519
      Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowInstalled.cs

2
Code/.gitignore

@ -0,0 +1,2 @@
.vs
packages

2
Code/CameraErrorCheck/.gitignore

@ -0,0 +1,2 @@
bin
obj

16
Code/CameraErrorCheck/App.config

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<connectionStrings>
<!-- 正式线上数据库连接 -->
<add name="MySqlConnString" connectionString="server=172.28.70.132;port=6033;user=smartcamp;password=C@mp_Smart#2022; database=smartcamp;SslMode=None;Allow User Variables=True;Charset=utf8;" />
<!-- 代码服务器测试库 -->
<!--<add name="MySqlConnString" connectionString="server=47.92.168.204;port=3547;user=root;password=KeNing_P@ssw0rd!; database=smartcamp;SslMode=None;Allow User Variables=True;Charset=utf8;" />-->
</connectionStrings>
</configuration>

99
Code/CameraErrorCheck/CameraErrorCheck.csproj

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{A0C6DA56-53F3-48BA-AEE1-741DD65AA19F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CameraErrorCheck</RootNamespace>
<AssemblyName>CameraErrorCheck</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data">
<HintPath>..\lib\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Vlc.DotNet.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=MSIL">
<HintPath>..\packages\Vlc.DotNet.Core.3.1.0\lib\net45\Vlc.DotNet.Core.dll</HintPath>
</Reference>
<Reference Include="Vlc.DotNet.Core.Interops, Version=3.1.0.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=MSIL">
<HintPath>..\packages\Vlc.DotNet.Core.Interops.3.1.0\lib\net45\Vlc.DotNet.Core.Interops.dll</HintPath>
</Reference>
<Reference Include="Vlc.DotNet.Forms, Version=3.1.0.0, Culture=neutral, PublicKeyToken=84529da31f4eb963, processorArchitecture=MSIL">
<HintPath>..\packages\Vlc.DotNet.Forms.3.1.0\lib\net45\Vlc.DotNet.Forms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CameraInfoMo.cs" />
<Compile Include="CameraMySqlHelp.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MyFileLogHelper.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

43
Code/CameraErrorCheck/CameraInfoMo.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CameraErrorCheck
{
/// <summary>
/// 摄像头信息数据模型
/// </summary>
public class CameraInfoMo
{
/// <summary>
/// 摄像头信息ID
/// </summary>
public string ID { get; set; }
/// <summary>
/// 摄像头编码
/// </summary>
public string C_NO { get; set; }
/// <summary>
/// 摄像头名称
/// </summary>
public string C_NAME { get; set; }
/// <summary>
/// 摄像头机构信息ID
/// </summary>
public string ORG_ID { get; set; }
/// <summary>
/// 摄像头机构名称
/// </summary>
public string ORG_NAME { get; set; }
/// <summary>
/// 云播放地址
/// </summary>
public string PLAYURL { get; set; }
}
}

147
Code/CameraErrorCheck/CameraMySqlHelp.cs

@ -0,0 +1,147 @@
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CameraErrorCheck
{
/// <summary>
/// 数据库查询帮助类
/// </summary>
public class CameraMySqlHelp
{
/// <summary>
/// 数据库连接字符串
/// </summary>
public static string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MySqlConnString"].ConnectionString;
/// <summary>
/// 执行查询语句,返回DataTable
/// </summary>
/// <param name="SQLString">查询语句</param>
/// <returns>DataTable</returns>
public static DataTable QueryTable(string SQLString)
{
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
var dt = new DataTable();
try
{
connection.Open();
MySqlDataAdapter command = new MySqlDataAdapter(SQLString, connection);
command.Fill(dt);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
if (connection.State == ConnectionState.Open)
{
connection.Close();
MySqlConnection.ClearPool(connection);//加入此行可释放连接
connection.Dispose();
}
GC.Collect();
}
return dt;
}
}
/// <summary>
/// 执行Sql并返回受影响行数
/// </summary>
/// <param name="SQLString">Sql语句</param>
/// <param name="cmdParms">参数</param>
/// <returns>受影响行数</returns>
public static int Execute(string SQLString)//Execute(string sql,)
{
return ExecuteSql(SQLString);
}
/// <summary>
/// 执行SQL语句,返回影响的记录数
/// </summary>
/// <param name="SQLString">SQL语句</param>
/// <returns>影响的记录数</returns>
public static int ExecuteSql(string SQLString)
{
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
using (MySqlCommand cmd = new MySqlCommand(SQLString, connection))
{
try
{
connection.Open();
int rows = cmd.ExecuteNonQuery();
return rows;
}
catch (Exception E)
{
connection.Close();
throw new Exception(E.Message);
}
finally
{
if (connection.State == ConnectionState.Open)
{
connection.Close();
MySqlConnection.ClearPool(connection);//加入此行可释放连接
connection.Dispose();
}
GC.Collect();
}
}
}
}
/// <summary>
/// 执行多条SQL语句,实现数据库事务。
/// </summary>
/// <param name="SQLStringList">多条SQL语句</param>
public static bool ExecuteSqlTran(List<string> SQLStringList)
{
var _result = false;
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
connection.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = connection;
MySqlTransaction tx = connection.BeginTransaction();
cmd.Transaction = tx;
try
{
foreach (var strSql in SQLStringList)
{
if (strSql.Trim().Length > 1)
{
cmd.CommandText = strSql;
cmd.ExecuteNonQuery();
}
}
tx.Commit();
_result = true;
}
catch (Exception E)
{
tx.Rollback();
}
finally
{
if (connection.State == ConnectionState.Open)
{
connection.Close();
MySqlConnection.ClearPool(connection);//加入此行可释放连接
connection.Dispose();
}
GC.Collect();
}
}
return _result;
}
}
}

163
Code/CameraErrorCheck/Form1.Designer.cs

@ -0,0 +1,163 @@

namespace CameraErrorCheck
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.vlcControl1 = new Vlc.DotNet.Forms.VlcControl();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.vlcControl1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.vlcControl1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(639, 371);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "视频监控";
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.richTextBox1);
this.groupBox2.Controls.Add(this.button3);
this.groupBox2.Controls.Add(this.button2);
this.groupBox2.Controls.Add(this.button1);
this.groupBox2.Location = new System.Drawing.Point(12, 389);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(639, 200);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "控制显示";
//
// button1
//
this.button1.Location = new System.Drawing.Point(15, 20);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "初始化";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBox1.Location = new System.Drawing.Point(113, 22);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(520, 172);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
//
// button2
//
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(15, 62);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 0;
this.button2.Text = "开始监控";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Enabled = false;
this.button3.Location = new System.Drawing.Point(15, 102);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 0;
this.button3.Text = "停止监控";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// vlcControl1
//
this.vlcControl1.BackColor = System.Drawing.Color.Black;
this.vlcControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.vlcControl1.Location = new System.Drawing.Point(3, 17);
this.vlcControl1.Name = "vlcControl1";
this.vlcControl1.Size = new System.Drawing.Size(633, 351);
this.vlcControl1.Spu = -1;
this.vlcControl1.TabIndex = 0;
this.vlcControl1.Text = "vlcControl1";
//this.vlcControl1.VlcLibDirectory = ((System.IO.DirectoryInfo)(resources.GetObject("vlcControl1.VlcLibDirectory")));
this.vlcControl1.VlcLibDirectory = new System.IO.DirectoryInfo(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath, "vlcLib"));
this.vlcControl1.VlcMediaplayerOptions = null;
this.vlcControl1.EncounteredError += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerEncounteredErrorEventArgs>(this.vlcControl1_EncounteredError);
this.vlcControl1.EndReached += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs>(this.vlcControl1_EndReached);
this.vlcControl1.Playing += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs>(this.vlcControl1_Playing);
this.vlcControl1.Stopped += new System.EventHandler<Vlc.DotNet.Core.VlcMediaPlayerStoppedEventArgs>(this.vlcControl1_Stopped);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(663, 601);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "视频监控";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.vlcControl1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private Vlc.DotNet.Forms.VlcControl vlcControl1;
}
}

363
Code/CameraErrorCheck/Form1.cs

@ -0,0 +1,363 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Vlc.DotNet.Forms;
namespace CameraErrorCheck
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/// <summary>
/// 线程Task
/// </summary>
Task t = null;
/// <summary>
/// 线程内循环是否继续
/// </summary>
bool bolWhere = true;
/// <summary>
/// 是否播放下一条视频
/// </summary>
bool bolIsNexCamera = false;
/// <summary>
/// 窗体初始化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_Load(object sender, EventArgs e)
{
t = new Task(() =>
{
while (bolWhere)
{
if (bolIsNexCamera)
{
if (listIndex >= listCamera.Count - 1)
{
listIndex = 0;
AddMsg(System.Environment.NewLine);
AddMsg("一轮播放结束,延迟一段时间后,再次循环");
AddMsg(System.Environment.NewLine);
AddMsg(System.Environment.NewLine);
MyFileLogHelper.WriteFire(new LogInfoMo() { message = System.Environment.NewLine, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = System.Environment.NewLine, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "***************************************", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "一轮播放结束,延迟一段时间后,再次循环", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
Thread.Sleep(1000 * 60 * 60 * 2);
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "延迟结束,再次循环", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "一轮播放结束,延迟一段时间后,再次循环", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = System.Environment.NewLine, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
MyFileLogHelper.WriteFire(new LogInfoMo() { message = System.Environment.NewLine, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
// Thread.Sleep(1000 * 60 * 2);
AddMsg(System.Environment.NewLine);
AddMsg("一轮播放结束,延迟一段时间后,再次循环");
AddMsg(System.Environment.NewLine);
AddMsg(System.Environment.NewLine);
}
AddMsg("控制播放");
bolIsNexCamera = false;
//调用播放方法
PalyNexCamera();
}
//Thread.Sleep(5000); //模拟工作过程
}
});
t.Start();
t.ContinueWith(task =>
{
AddMsg("任务完成,完成时候的状态为:");
AddMsg(string.Format("IsCanceled={0}\tIsCompleted={1}\tIsFaulted={2}",
task.IsCanceled, task.IsCompleted, task.IsFaulted));
});
}
/// <summary>
/// 摄像头数据缓存
/// </summary>
List<CameraInfoMo> listCamera = new List<CameraInfoMo>();
/// <summary>
/// 遍历索引
/// </summary>
int listIndex = 0;
/// <summary>
/// 初始化按钮点击
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
try
{
//摄像头查询SQL
string sqlStr = @"SELECT * from tbl_camera WHERE ORG_ID in (SELECT org_id from fire_org,(select get_Org_child_list('D8DC637B8B984848A63F82A018AFAEB0') cids ) s
WHERE find_in_set(org_id,cids) ) and PLAYURL like 'http%' ";
//查询数据
var dt = CameraMySqlHelp.QueryTable(sqlStr);
//清空缓存集合
listCamera.Clear();
AddMsg("查询数据:" + dt.Rows.Count + "条");
for (int i = 0; i < dt.Rows.Count; i++)
{
try
{
listCamera.Add(new CameraInfoMo()
{
C_NAME = dt.Rows[i]["C_NAME"] + "",
C_NO = dt.Rows[i]["C_NO"] + "",
ID = dt.Rows[i]["ID"] + "",
ORG_ID = dt.Rows[i]["ORG_ID"] + "",
ORG_NAME = dt.Rows[i]["ORG_NAME"] + "",
PLAYURL = dt.Rows[i]["PLAYURL"] + "",
});
}
catch (Exception ex)
{
AddMsg("摄像头数据加载缓存异常:索引" + i + ",异常信息:" + ex);
}
}
listIndex = 0;
AddMsg("摄像头数据加入缓存完毕");
//允许开始按钮点击
button2.Enabled = true;
//初始化禁用按钮点击
button1.Enabled = false;
}
catch (Exception ex)
{
AddMsg("初始化数据异常:" + ex);
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "初始化数据异常:" + ex, msgType = EnumLogMsgTypeEnum.Error, path = "Error" });
}
}
/// <summary>
/// 开始监控
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
bolIsNexCamera = true;
button2.Enabled = false;
button3.Enabled = true;
}
/// <summary>
/// 停止监控
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
bolIsNexCamera = false;
button2.Enabled = true;
button1.Enabled = true;
}
/// <summary>
/// 控制播放
/// </summary>
private void PalyNexCamera()
{
try
{
if (listCamera.Count > listIndex)
{
AddMsg("播放视频:" + listCamera[listIndex].PLAYURL);
vlcControl1.Play(new Uri(listCamera[listIndex].PLAYURL));
vlcControl1.Tag = listCamera[listIndex].ID;
listIndex++;
}
}
catch (Exception ex)
{
AddMsg("播放视频异常:" + ex);
}
}
/// <summary>
/// 视频播放
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void vlcControl1_Playing(object sender, Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs e)
{
var vlcObj = (VlcControl)sender;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "视频播放正常,信息ID:" + vlcObj.Tag, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
UpdCampStart(vlcObj.Tag + "", "0");
}
/// <summary>
/// 播放错误
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void vlcControl1_EncounteredError(object sender, Vlc.DotNet.Core.VlcMediaPlayerEncounteredErrorEventArgs e)
{
var vlcObj = (VlcControl)sender;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "视频播放错误,信息ID:" + vlcObj.Tag, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
UpdCampStart(vlcObj.Tag + "", "1");
}
/// <summary>
/// 播放结束
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void vlcControl1_EndReached(object sender, Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs e)
{
var vlcObj = (VlcControl)sender;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "视频播放结束,信息ID:" + vlcObj.Tag, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
UpdCampStart(vlcObj.Tag + "", "1");
}
/// <summary>
/// 播放停止
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void vlcControl1_Stopped(object sender, Vlc.DotNet.Core.VlcMediaPlayerStoppedEventArgs e)
{
var vlcObj = (VlcControl)sender;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "视频播放停止,信息ID:" + vlcObj.Tag, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
UpdCampStart(vlcObj.Tag + "", "1");
}
/// <summary>
/// 上一条更新摄像头ID
/// </summary>
private string SubCid = "";
/// <summary>
/// 上一条更新状态
/// </summary>
private string SubC_STATE = "";
/// <summary>
/// 更新摄像头播放状态
/// </summary>
/// <param name="cid">摄像头信息ID</param>
/// <param name="C_STATE">状态:0、在线;1、离线;</param>
private void UpdCampStart(string cid, string C_STATE)
{
//判断当前更新是否与上次更新一致
if (SubCid.Equals(cid) && SubC_STATE.Equals(C_STATE))
{
//设置允许继续进行下一条数据播放
bolIsNexCamera = true;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "状态更新与上次一致,信息ID:" + cid + ",信息状态:" + C_STATE, msgType = EnumLogMsgTypeEnum.Error, path = "Error" });
return;
}
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "更新信息状态:信息ID:" + cid + ",信息状态:" + C_STATE, msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
try
{
//拼接状态更新Sql
string sqlUpd = " UPDATE tbl_camera set C_STATE='" + C_STATE + "' WHERE id='" + cid + "' ";
//执行Sql
CameraMySqlHelp.ExecuteSql(sqlUpd);
}
catch (Exception ex)
{
AddMsg("更新状态异常:" + ex);
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "更新状态异常:" + ex, msgType = EnumLogMsgTypeEnum.Error, path = "Error" });
}
try
{
//实例化信息ID
string ID = Guid.NewGuid().ToString("N");
//拼接插入验证日志Sql
string sqlIns = " INSERT INTO tbl_camera_check_log (ID,CID,createtime,C_STATE) VALUES ('" + ID + "','" + cid + "',NOW(),'" + C_STATE + "') ";
//执行Sql
CameraMySqlHelp.ExecuteSql(sqlIns);
}
catch (Exception ex)
{
AddMsg("插入验证记录异常:" + ex);
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "插入验证记录异常:" + ex, msgType = EnumLogMsgTypeEnum.Error, path = "Error" });
}
SubCid = cid;
SubC_STATE = C_STATE;
//控制
switch (C_STATE)
{
//正常播放
case "0":
//延迟10秒后继续播放下一条
new Thread(() =>
{
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "正常播放,延迟5秒后继续播放下一条", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
Thread.Sleep(1000 * 5);
bolIsNexCamera = true;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "正常播放,继续播放下一条", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
}).Start();
break;
//异常播放
default:
//设置允许继续进行下一条数据播放
bolIsNexCamera = true;
MyFileLogHelper.WriteFire(new LogInfoMo() { message = "异常播放,继续播放下一条", msgType = EnumLogMsgTypeEnum.Error, path = "Info" });
break;
}
}
/// <summary>
/// 添加显示消息信息
/// </summary>
/// <param name="msgStr"></param>
private void AddMsg(string msgStr)
{
try
{
richTextBox1.Invoke(new MethodInvoker(() =>
{
//判断显示信息是否超过1万字
if (richTextBox1.Text.Length > 100000)
{
//文字太多,清除
richTextBox1.Clear();
}
//添加显示文字
richTextBox1.AppendText(DateTime.Now + " " + msgStr + System.Environment.NewLine);
}));
}
catch (Exception ex)
{
}
}
/// <summary>
/// 程序退出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
//停止线程内循环
bolWhere = false;
}
catch (Exception ex)
{
}
}
}
}

127
Code/CameraErrorCheck/Form1.resx

@ -0,0 +1,127 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="vlcControl1.VlcLibDirectory" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAEAQAAABdTeXN0ZW0uSU8uRGlyZWN0b3J5SW5mbwIAAAAMT3JpZ2luYWxQ
YXRoCEZ1bGxQYXRoAQEGAgAAADpEOlx3clxUZXN0UHJvamVjdFxUZXN0UHJvamVjdFxUZXN0VkxDUGxh
eVxiaW5cRGVidWdcVmxjTGliCQIAAAAL
</value>
</data>
</root>

92
Code/CameraErrorCheck/MyFileLogHelper.cs

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CameraErrorCheck
{
/// <summary>
/// 文件帮助类
/// </summary>
public class MyFileLogHelper
{
/// <summary>
/// 将信息写入文件
/// </summary>
/// <param name="msgType"></param>
/// <param name="msg"></param>
public static void WriteFire(LogInfoMo infoObj)
{
try
{
//获取程序所在目录
string pathStr = AppDomain.CurrentDomain.BaseDirectory + "log\\" + (string.IsNullOrEmpty(infoObj.path) ? "" : infoObj.path + "\\") +
DateTime.Now.Year + "\\" + DateTime.Now.ToString("yyyyMM") + "\\" + DateTime.Now.ToString("yyyyMMdd") + "\\";
//判断文件夹是否存在
if (Directory.Exists(pathStr) == false)
{
//不存在文件夹则创建
Directory.CreateDirectory(pathStr);
}
string firePath = pathStr + infoObj.msgType.ToString() + DateTime.Now.ToString("yyyyMMddHH") + ".txt";
using (FileStream fs = new FileStream(firePath, FileMode.Append, FileAccess.Write))
{
using (StreamWriter sw = new StreamWriter(fs))
{
string str = DateTime.Now + "\t" + infoObj.message;
sw.WriteLine(str);
}
}
}
catch (Exception ex)
{
string str = DateTime.Now + "\t 文件写入异常:" + ex;
}
}
}
/// <summary>
/// 记录信息数据模型
/// </summary>
public class LogInfoMo
{
/// <summary>
/// 信息保存路径,默认不单独保存
/// </summary>
public string path { get; set; }
/// <summary>
/// 记录信息内容字符串
/// </summary>
public string message { get; set; }
/// <summary>
/// 信息类型
/// </summary>
public EnumLogMsgTypeEnum msgType { get; set; }
}
/// <summary>
/// 日志信息类型枚举
/// </summary>
public enum EnumLogMsgTypeEnum
{
/// <summary>
/// 正常信息
/// </summary>
Info = 0,
/// <summary>
/// 错误信息
/// </summary>
Error = 1,
/// <summary>
/// 调试信息
/// </summary>
Debug = 2,
}
}

22
Code/CameraErrorCheck/Program.cs

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CameraErrorCheck
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

36
Code/CameraErrorCheck/Properties/AssemblyInfo.cs

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CameraErrorCheck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CameraErrorCheck")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a0c6da56-53f3-48ba-aee1-741dd65aa19f")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

70
Code/CameraErrorCheck/Properties/Resources.Designer.cs

@ -0,0 +1,70 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace CameraErrorCheck.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[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>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </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("CameraErrorCheck.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

117
Code/CameraErrorCheck/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>

29
Code/CameraErrorCheck/Properties/Settings.Designer.cs

@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <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 CameraErrorCheck.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
Code/CameraErrorCheck/Properties/Settings.settings

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

6
Code/CameraErrorCheck/packages.config

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Vlc.DotNet.Core" version="3.1.0" targetFramework="net45" />
<package id="Vlc.DotNet.Core.Interops" version="3.1.0" targetFramework="net45" />
<package id="Vlc.DotNet.Forms" version="3.1.0" targetFramework="net45" />
</packages>

1
Code/ClassLib/.gitignore

@ -0,0 +1 @@
FYORM

2
Code/ClassLib/RoadFlow/LitJSON/.gitignore

@ -0,0 +1,2 @@
bin
obj

60
Code/ClassLib/RoadFlow/LitJSON/IJsonWrapper.cs

@ -0,0 +1,60 @@
#region Header
/**
* IJsonWrapper.cs
* Interface that represents a type capable of handling all kinds of JSON
* data. This is mainly used when mapping objects through JsonMapper, and
* it's implemented by JsonData.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System.Collections;
using System.Collections.Specialized;
namespace LitJson
{
public enum JsonType
{
None,
Object,
Array,
String,
Int,
Long,
Double,
Boolean
}
public interface IJsonWrapper : IList, IOrderedDictionary
{
bool IsArray { get; }
bool IsBoolean { get; }
bool IsDouble { get; }
bool IsInt { get; }
bool IsLong { get; }
bool IsObject { get; }
bool IsString { get; }
bool GetBoolean ();
double GetDouble ();
int GetInt ();
JsonType GetJsonType ();
long GetLong ();
string GetString ();
void SetBoolean (bool val);
void SetDouble (double val);
void SetInt (int val);
void SetJsonType (JsonType type);
void SetLong (long val);
void SetString (string val);
string ToJson ();
void ToJson (JsonWriter writer);
}
}

1007
Code/ClassLib/RoadFlow/LitJSON/JsonData.cs

File diff suppressed because it is too large

60
Code/ClassLib/RoadFlow/LitJSON/JsonException.cs

@ -0,0 +1,60 @@
#region Header
/**
* JsonException.cs
* Base class throwed by LitJSON when a parsing error occurs.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
namespace LitJson
{
public class JsonException : ApplicationException
{
public JsonException () : base ()
{
}
internal JsonException (ParserToken token) :
base (String.Format (
"Invalid token '{0}' in input string", token))
{
}
internal JsonException (ParserToken token,
Exception inner_exception) :
base (String.Format (
"Invalid token '{0}' in input string", token),
inner_exception)
{
}
internal JsonException (int c) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c))
{
}
internal JsonException (int c, Exception inner_exception) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c),
inner_exception)
{
}
public JsonException (string message) : base (message)
{
}
public JsonException (string message, Exception inner_exception) :
base (message, inner_exception)
{
}
}
}

925
Code/ClassLib/RoadFlow/LitJSON/JsonMapper.cs

@ -0,0 +1,925 @@
#region Header
/**
* JsonMapper.cs
* JSON to .Net object and object to JSON conversions.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
namespace LitJson
{
internal struct PropertyMetadata
{
public MemberInfo Info;
public bool IsField;
public Type Type;
}
internal struct ArrayMetadata
{
private Type element_type;
private bool is_array;
private bool is_list;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsArray {
get { return is_array; }
set { is_array = value; }
}
public bool IsList {
get { return is_list; }
set { is_list = value; }
}
}
internal struct ObjectMetadata
{
private Type element_type;
private bool is_dictionary;
private IDictionary<string, PropertyMetadata> properties;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsDictionary {
get { return is_dictionary; }
set { is_dictionary = value; }
}
public IDictionary<string, PropertyMetadata> Properties {
get { return properties; }
set { properties = value; }
}
}
internal delegate void ExporterFunc (object obj, JsonWriter writer);
public delegate void ExporterFunc<T> (T obj, JsonWriter writer);
internal delegate object ImporterFunc (object input);
public delegate TValue ImporterFunc<TJson, TValue> (TJson input);
public delegate IJsonWrapper WrapperFactory ();
public class JsonMapper
{
#region Fields
private static int max_nesting_depth;
private static IFormatProvider datetime_format;
private static IDictionary<Type, ExporterFunc> base_exporters_table;
private static IDictionary<Type, ExporterFunc> custom_exporters_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> base_importers_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> custom_importers_table;
private static IDictionary<Type, ArrayMetadata> array_metadata;
private static readonly object array_metadata_lock = new Object ();
private static IDictionary<Type,
IDictionary<Type, MethodInfo>> conv_ops;
private static readonly object conv_ops_lock = new Object ();
private static IDictionary<Type, ObjectMetadata> object_metadata;
private static readonly object object_metadata_lock = new Object ();
private static IDictionary<Type,
IList<PropertyMetadata>> type_properties;
private static readonly object type_properties_lock = new Object ();
private static JsonWriter static_writer;
private static readonly object static_writer_lock = new Object ();
#endregion
#region Constructors
static JsonMapper ()
{
max_nesting_depth = 100;
array_metadata = new Dictionary<Type, ArrayMetadata> ();
conv_ops = new Dictionary<Type, IDictionary<Type, MethodInfo>> ();
object_metadata = new Dictionary<Type, ObjectMetadata> ();
type_properties = new Dictionary<Type,
IList<PropertyMetadata>> ();
static_writer = new JsonWriter ();
datetime_format = DateTimeFormatInfo.InvariantInfo;
base_exporters_table = new Dictionary<Type, ExporterFunc> ();
custom_exporters_table = new Dictionary<Type, ExporterFunc> ();
base_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
custom_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
RegisterBaseExporters ();
RegisterBaseImporters ();
}
#endregion
#region Private Methods
private static void AddArrayMetadata (Type type)
{
if (array_metadata.ContainsKey (type))
return;
ArrayMetadata data = new ArrayMetadata ();
data.IsArray = type.IsArray;
if (type.GetInterface ("System.Collections.IList") != null)
data.IsList = true;
foreach (PropertyInfo p_info in type.GetProperties ()) {
if (p_info.Name != "Item")
continue;
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (int))
data.ElementType = p_info.PropertyType;
}
lock (array_metadata_lock) {
try {
array_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddObjectMetadata (Type type)
{
if (object_metadata.ContainsKey (type))
return;
ObjectMetadata data = new ObjectMetadata ();
if (type.GetInterface ("System.Collections.IDictionary") != null)
data.IsDictionary = true;
data.Properties = new Dictionary<string, PropertyMetadata> ();
foreach (PropertyInfo p_info in type.GetProperties ()) {
if (p_info.Name == "Item") {
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (string))
data.ElementType = p_info.PropertyType;
continue;
}
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.Type = p_info.PropertyType;
data.Properties.Add (p_info.Name, p_data);
}
foreach (FieldInfo f_info in type.GetFields ()) {
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
p_data.Type = f_info.FieldType;
data.Properties.Add (f_info.Name, p_data);
}
lock (object_metadata_lock) {
try {
object_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddTypeProperties (Type type)
{
if (type_properties.ContainsKey (type))
return;
IList<PropertyMetadata> props = new List<PropertyMetadata> ();
foreach (PropertyInfo p_info in type.GetProperties ()) {
if (p_info.Name == "Item")
continue;
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.IsField = false;
props.Add (p_data);
}
foreach (FieldInfo f_info in type.GetFields ()) {
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
props.Add (p_data);
}
lock (type_properties_lock) {
try {
type_properties.Add (type, props);
} catch (ArgumentException) {
return;
}
}
}
private static MethodInfo GetConvOp (Type t1, Type t2)
{
lock (conv_ops_lock) {
if (! conv_ops.ContainsKey (t1))
conv_ops.Add (t1, new Dictionary<Type, MethodInfo> ());
}
if (conv_ops[t1].ContainsKey (t2))
return conv_ops[t1][t2];
MethodInfo op = t1.GetMethod (
"op_Implicit", new Type[] { t2 });
lock (conv_ops_lock) {
try {
conv_ops[t1].Add (t2, op);
} catch (ArgumentException) {
return conv_ops[t1][t2];
}
}
return op;
}
private static object ReadValue (Type inst_type, JsonReader reader)
{
reader.Read ();
if (reader.Token == JsonToken.ArrayEnd)
return null;
if (reader.Token == JsonToken.Null) {
if (! inst_type.IsClass)
throw new JsonException (String.Format (
"Can't assign null to an instance of type {0}",
inst_type));
return null;
}
if (reader.Token == JsonToken.Double ||
reader.Token == JsonToken.Int ||
reader.Token == JsonToken.Long ||
reader.Token == JsonToken.String ||
reader.Token == JsonToken.Boolean) {
Type json_type = reader.Value.GetType ();
if (inst_type.IsAssignableFrom (json_type))
return reader.Value;
// If there's a custom importer that fits, use it
if (custom_importers_table.ContainsKey (json_type) &&
custom_importers_table[json_type].ContainsKey (
inst_type)) {
ImporterFunc importer =
custom_importers_table[json_type][inst_type];
return importer (reader.Value);
}
// Maybe there's a base importer that works
if (base_importers_table.ContainsKey (json_type) &&
base_importers_table[json_type].ContainsKey (
inst_type)) {
ImporterFunc importer =
base_importers_table[json_type][inst_type];
return importer (reader.Value);
}
// Maybe it's an enum
if (inst_type.IsEnum)
return Enum.ToObject (inst_type, reader.Value);
// Try using an implicit conversion operator
MethodInfo conv_op = GetConvOp (inst_type, json_type);
if (conv_op != null)
return conv_op.Invoke (null,
new object[] { reader.Value });
// No luck
throw new JsonException (String.Format (
"Can't assign value '{0}' (type {1}) to type {2}",
reader.Value, json_type, inst_type));
}
object instance = null;
if (reader.Token == JsonToken.ArrayStart) {
AddArrayMetadata (inst_type);
ArrayMetadata t_data = array_metadata[inst_type];
if (! t_data.IsArray && ! t_data.IsList)
throw new JsonException (String.Format (
"Type {0} can't act as an array",
inst_type));
IList list;
Type elem_type;
if (! t_data.IsArray) {
list = (IList) Activator.CreateInstance (inst_type);
elem_type = t_data.ElementType;
} else {
list = new ArrayList ();
elem_type = inst_type.GetElementType ();
}
while (true) {
object item = ReadValue (elem_type, reader);
if (item == null && reader.Token == JsonToken.ArrayEnd)
break;
list.Add (item);
}
if (t_data.IsArray) {
int n = list.Count;
instance = Array.CreateInstance (elem_type, n);
for (int i = 0; i < n; i++)
((Array) instance).SetValue (list[i], i);
} else
instance = list;
} else if (reader.Token == JsonToken.ObjectStart) {
AddObjectMetadata (inst_type);
ObjectMetadata t_data = object_metadata[inst_type];
instance = Activator.CreateInstance (inst_type);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
if (t_data.Properties.ContainsKey (property)) {
PropertyMetadata prop_data =
t_data.Properties[property];
if (prop_data.IsField) {
((FieldInfo) prop_data.Info).SetValue (
instance, ReadValue (prop_data.Type, reader));
} else {
PropertyInfo p_info =
(PropertyInfo) prop_data.Info;
if (p_info.CanWrite)
p_info.SetValue (
instance,
ReadValue (prop_data.Type, reader),
null);
else
ReadValue (prop_data.Type, reader);
}
} else {
if (! t_data.IsDictionary) {
if (! reader.SkipNonMembers) {
throw new JsonException (String.Format (
"The type {0} doesn't have the " +
"property '{1}'",
inst_type, property));
} else {
ReadSkip (reader);
continue;
}
}
((IDictionary) instance).Add (
property, ReadValue (
t_data.ElementType, reader));
}
}
}
return instance;
}
private static IJsonWrapper ReadValue (WrapperFactory factory,
JsonReader reader)
{
reader.Read ();
if (reader.Token == JsonToken.ArrayEnd ||
reader.Token == JsonToken.Null)
return null;
IJsonWrapper instance = factory ();
if (reader.Token == JsonToken.String) {
instance.SetString ((string) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Double) {
instance.SetDouble ((double) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Int) {
instance.SetInt ((int) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Long) {
instance.SetLong ((long) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Boolean) {
instance.SetBoolean ((bool) reader.Value);
return instance;
}
if (reader.Token == JsonToken.ArrayStart) {
instance.SetJsonType (JsonType.Array);
while (true) {
IJsonWrapper item = ReadValue (factory, reader);
if (item == null && reader.Token == JsonToken.ArrayEnd)
break;
((IList) instance).Add (item);
}
}
else if (reader.Token == JsonToken.ObjectStart) {
instance.SetJsonType (JsonType.Object);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
((IDictionary) instance)[property] = ReadValue (
factory, reader);
}
}
return instance;
}
private static void ReadSkip (JsonReader reader)
{
ToWrapper (
delegate { return new JsonMockWrapper (); }, reader);
}
private static void RegisterBaseExporters ()
{
base_exporters_table[typeof (byte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((byte) obj));
};
base_exporters_table[typeof (char)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((char) obj));
};
base_exporters_table[typeof (DateTime)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((DateTime) obj,
datetime_format));
};
base_exporters_table[typeof (decimal)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((decimal) obj);
};
base_exporters_table[typeof (sbyte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((sbyte) obj));
};
base_exporters_table[typeof (short)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((short) obj));
};
base_exporters_table[typeof (ushort)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((ushort) obj));
};
base_exporters_table[typeof (uint)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToUInt64 ((uint) obj));
};
base_exporters_table[typeof (ulong)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((ulong) obj);
};
}
private static void RegisterBaseImporters ()
{
ImporterFunc importer;
importer = delegate (object input) {
return Convert.ToByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (byte), importer);
importer = delegate (object input) {
return Convert.ToUInt64 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ulong), importer);
importer = delegate (object input) {
return Convert.ToSByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (sbyte), importer);
importer = delegate (object input) {
return Convert.ToInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (short), importer);
importer = delegate (object input) {
return Convert.ToUInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ushort), importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToSingle ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (float), importer);
importer = delegate (object input) {
return Convert.ToDouble ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (double), importer);
importer = delegate (object input) {
return Convert.ToDecimal ((double) input);
};
RegisterImporter (base_importers_table, typeof (double),
typeof (decimal), importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((long) input);
};
RegisterImporter (base_importers_table, typeof (long),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToChar ((string) input);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (char), importer);
importer = delegate (object input) {
return Convert.ToDateTime ((string) input, datetime_format);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (DateTime), importer);
}
private static void RegisterImporter (
IDictionary<Type, IDictionary<Type, ImporterFunc>> table,
Type json_type, Type value_type, ImporterFunc importer)
{
if (! table.ContainsKey (json_type))
table.Add (json_type, new Dictionary<Type, ImporterFunc> ());
table[json_type][value_type] = importer;
}
private static void WriteValue (object obj, JsonWriter writer,
bool writer_is_private,
int depth)
{
if (depth > max_nesting_depth)
throw new JsonException (
String.Format ("Max allowed object depth reached while " +
"trying to export from type {0}",
obj.GetType ()));
if (obj == null) {
writer.Write (null);
return;
}
if (obj is IJsonWrapper) {
if (writer_is_private)
writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ());
else
((IJsonWrapper) obj).ToJson (writer);
return;
}
if (obj is String) {
writer.Write ((string) obj);
return;
}
if (obj is Double) {
writer.Write ((double) obj);
return;
}
if (obj is Int32) {
writer.Write ((int) obj);
return;
}
if (obj is Boolean) {
writer.Write ((bool) obj);
return;
}
if (obj is Int64) {
writer.Write ((long) obj);
return;
}
if (obj is Array) {
writer.WriteArrayStart ();
foreach (object elem in (Array) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IList) {
writer.WriteArrayStart ();
foreach (object elem in (IList) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IDictionary) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in (IDictionary) obj) {
writer.WritePropertyName ((string) entry.Key);
WriteValue (entry.Value, writer, writer_is_private,
depth + 1);
}
writer.WriteObjectEnd ();
return;
}
Type obj_type = obj.GetType ();
// See if there's a custom exporter for the object
if (custom_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = custom_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// If not, maybe there's a base exporter
if (base_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = base_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// Last option, let's see if it's an enum
if (obj is Enum) {
Type e_type = Enum.GetUnderlyingType (obj_type);
if (e_type == typeof (long)
|| e_type == typeof (uint)
|| e_type == typeof (ulong))
writer.Write ((ulong) obj);
else
writer.Write ((int) obj);
return;
}
// Okay, so it looks like the input should be exported as an
// object
AddTypeProperties (obj_type);
IList<PropertyMetadata> props = type_properties[obj_type];
writer.WriteObjectStart ();
foreach (PropertyMetadata p_data in props) {
if (p_data.IsField) {
writer.WritePropertyName (p_data.Info.Name);
WriteValue (((FieldInfo) p_data.Info).GetValue (obj),
writer, writer_is_private, depth + 1);
}
else {
PropertyInfo p_info = (PropertyInfo) p_data.Info;
if (p_info.CanRead) {
writer.WritePropertyName (p_data.Info.Name);
WriteValue (p_info.GetValue (obj, null),
writer, writer_is_private, depth + 1);
}
}
}
writer.WriteObjectEnd ();
}
#endregion
public static string ToJson (object obj)
{
lock (static_writer_lock) {
static_writer.Reset ();
WriteValue (obj, static_writer, true, 0);
return static_writer.ToString ();
}
}
public static void ToJson (object obj, JsonWriter writer)
{
WriteValue (obj, writer, false, 0);
}
public static JsonData ToObject (JsonReader reader)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, reader);
}
public static JsonData ToObject (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json_reader);
}
public static JsonData ToObject (string json)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json);
}
public static T ToObject<T> (JsonReader reader)
{
return (T) ReadValue (typeof (T), reader);
}
public static T ToObject<T> (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (T) ReadValue (typeof (T), json_reader);
}
public static T ToObject<T> (string json)
{
JsonReader reader = new JsonReader (json);
return (T) ReadValue (typeof (T), reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
JsonReader reader)
{
return ReadValue (factory, reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
string json)
{
JsonReader reader = new JsonReader (json);
return ReadValue (factory, reader);
}
public static void RegisterExporter<T> (ExporterFunc<T> exporter)
{
ExporterFunc exporter_wrapper =
delegate (object obj, JsonWriter writer) {
exporter ((T) obj, writer);
};
custom_exporters_table[typeof (T)] = exporter_wrapper;
}
public static void RegisterImporter<TJson, TValue> (
ImporterFunc<TJson, TValue> importer)
{
ImporterFunc importer_wrapper =
delegate (object input) {
return importer ((TJson) input);
};
RegisterImporter (custom_importers_table, typeof (TJson),
typeof (TValue), importer_wrapper);
}
public static void UnregisterExporters ()
{
custom_exporters_table.Clear ();
}
public static void UnregisterImporters ()
{
custom_importers_table.Clear ();
}
}
}

105
Code/ClassLib/RoadFlow/LitJSON/JsonMockWrapper.cs

@ -0,0 +1,105 @@
#region Header
/**
* JsonMockWrapper.cs
* Mock object implementing IJsonWrapper, to facilitate actions like
* skipping data more efficiently.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
using System.Collections;
using System.Collections.Specialized;
namespace LitJson
{
public class JsonMockWrapper : IJsonWrapper
{
public bool IsArray { get { return false; } }
public bool IsBoolean { get { return false; } }
public bool IsDouble { get { return false; } }
public bool IsInt { get { return false; } }
public bool IsLong { get { return false; } }
public bool IsObject { get { return false; } }
public bool IsString { get { return false; } }
public bool GetBoolean () { return false; }
public double GetDouble () { return 0.0; }
public int GetInt () { return 0; }
public JsonType GetJsonType () { return JsonType.None; }
public long GetLong () { return 0L; }
public string GetString () { return ""; }
public void SetBoolean (bool val) {}
public void SetDouble (double val) {}
public void SetInt (int val) {}
public void SetJsonType (JsonType type) {}
public void SetLong (long val) {}
public void SetString (string val) {}
public string ToJson () { return ""; }
public void ToJson (JsonWriter writer) {}
bool IList.IsFixedSize { get { return true; } }
bool IList.IsReadOnly { get { return true; } }
object IList.this[int index] {
get { return null; }
set {}
}
int IList.Add (object value) { return 0; }
void IList.Clear () {}
bool IList.Contains (object value) { return false; }
int IList.IndexOf (object value) { return -1; }
void IList.Insert (int i, object v) {}
void IList.Remove (object value) {}
void IList.RemoveAt (int index) {}
int ICollection.Count { get { return 0; } }
bool ICollection.IsSynchronized { get { return false; } }
object ICollection.SyncRoot { get { return null; } }
void ICollection.CopyTo (Array array, int index) {}
IEnumerator IEnumerable.GetEnumerator () { return null; }
bool IDictionary.IsFixedSize { get { return true; } }
bool IDictionary.IsReadOnly { get { return true; } }
ICollection IDictionary.Keys { get { return null; } }
ICollection IDictionary.Values { get { return null; } }
object IDictionary.this[object key] {
get { return null; }
set {}
}
void IDictionary.Add (object k, object v) {}
void IDictionary.Clear () {}
bool IDictionary.Contains (object key) { return false; }
void IDictionary.Remove (object key) {}
IDictionaryEnumerator IDictionary.GetEnumerator () { return null; }
object IOrderedDictionary.this[int idx] {
get { return null; }
set {}
}
IDictionaryEnumerator IOrderedDictionary.GetEnumerator () {
return null;
}
void IOrderedDictionary.Insert (int i, object k, object v) {}
void IOrderedDictionary.RemoveAt (int i) {}
}
}

464
Code/ClassLib/RoadFlow/LitJSON/JsonReader.cs

@ -0,0 +1,464 @@
#region Header
/**
* JsonReader.cs
* Stream-like access to JSON text.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace LitJson
{
public enum JsonToken
{
None,
ObjectStart,
PropertyName,
ObjectEnd,
ArrayStart,
ArrayEnd,
Int,
Long,
Double,
String,
Boolean,
Null
}
public class JsonReader
{
#region Fields
private static IDictionary<int, IDictionary<int, int[]>> parse_table;
private Stack<int> automaton_stack;
private int current_input;
private int current_symbol;
private bool end_of_json;
private bool end_of_input;
private Lexer lexer;
private bool parser_in_string;
private bool parser_return;
private bool read_started;
private TextReader reader;
private bool reader_is_owned;
private bool skip_non_members;
private object token_value;
private JsonToken token;
#endregion
#region Public Properties
public bool AllowComments {
get { return lexer.AllowComments; }
set { lexer.AllowComments = value; }
}
public bool AllowSingleQuotedStrings {
get { return lexer.AllowSingleQuotedStrings; }
set { lexer.AllowSingleQuotedStrings = value; }
}
public bool SkipNonMembers {
get { return skip_non_members; }
set { skip_non_members = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public bool EndOfJson {
get { return end_of_json; }
}
public JsonToken Token {
get { return token; }
}
public object Value {
get { return token_value; }
}
#endregion
#region Constructors
static JsonReader ()
{
PopulateParseTable ();
}
public JsonReader (string json_text) :
this (new StringReader (json_text), true)
{
}
public JsonReader (TextReader reader) :
this (reader, false)
{
}
private JsonReader (TextReader reader, bool owned)
{
if (reader == null)
throw new ArgumentNullException ("reader");
parser_in_string = false;
parser_return = false;
read_started = false;
automaton_stack = new Stack<int> ();
automaton_stack.Push ((int) ParserToken.End);
automaton_stack.Push ((int) ParserToken.Text);
lexer = new Lexer (reader);
end_of_input = false;
end_of_json = false;
skip_non_members = true;
this.reader = reader;
reader_is_owned = owned;
}
#endregion
#region Static Methods
private static void PopulateParseTable ()
{
// See section A.2. of the manual for details
parse_table = new Dictionary<int, IDictionary<int, int[]>> ();
TableAddRow (ParserToken.Array);
TableAddCol (ParserToken.Array, '[',
'[',
(int) ParserToken.ArrayPrime);
TableAddRow (ParserToken.ArrayPrime);
TableAddCol (ParserToken.ArrayPrime, '"',
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, '[',
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, ']',
']');
TableAddCol (ParserToken.ArrayPrime, '{',
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.Number,
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.True,
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.False,
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.Null,
(int) ParserToken.Value,
(int) ParserToken.ValueRest,
']');
TableAddRow (ParserToken.Object);
TableAddCol (ParserToken.Object, '{',
'{',
(int) ParserToken.ObjectPrime);
TableAddRow (ParserToken.ObjectPrime);
TableAddCol (ParserToken.ObjectPrime, '"',
(int) ParserToken.Pair,
(int) ParserToken.PairRest,
'}');
TableAddCol (ParserToken.ObjectPrime, '}',
'}');
TableAddRow (ParserToken.Pair);
TableAddCol (ParserToken.Pair, '"',
(int) ParserToken.String,
':',
(int) ParserToken.Value);
TableAddRow (ParserToken.PairRest);
TableAddCol (ParserToken.PairRest, ',',
',',
(int) ParserToken.Pair,
(int) ParserToken.PairRest);
TableAddCol (ParserToken.PairRest, '}',
(int) ParserToken.Epsilon);
TableAddRow (ParserToken.String);
TableAddCol (ParserToken.String, '"',
'"',
(int) ParserToken.CharSeq,
'"');
TableAddRow (ParserToken.Text);
TableAddCol (ParserToken.Text, '[',
(int) ParserToken.Array);
TableAddCol (ParserToken.Text, '{',
(int) ParserToken.Object);
TableAddRow (ParserToken.Value);
TableAddCol (ParserToken.Value, '"',
(int) ParserToken.String);
TableAddCol (ParserToken.Value, '[',
(int) ParserToken.Array);
TableAddCol (ParserToken.Value, '{',
(int) ParserToken.Object);
TableAddCol (ParserToken.Value, (int) ParserToken.Number,
(int) ParserToken.Number);
TableAddCol (ParserToken.Value, (int) ParserToken.True,
(int) ParserToken.True);
TableAddCol (ParserToken.Value, (int) ParserToken.False,
(int) ParserToken.False);
TableAddCol (ParserToken.Value, (int) ParserToken.Null,
(int) ParserToken.Null);
TableAddRow (ParserToken.ValueRest);
TableAddCol (ParserToken.ValueRest, ',',
',',
(int) ParserToken.Value,
(int) ParserToken.ValueRest);
TableAddCol (ParserToken.ValueRest, ']',
(int) ParserToken.Epsilon);
}
private static void TableAddCol (ParserToken row, int col,
params int[] symbols)
{
parse_table[(int) row].Add (col, symbols);
}
private static void TableAddRow (ParserToken rule)
{
parse_table.Add ((int) rule, new Dictionary<int, int[]> ());
}
#endregion
#region Private Methods
private void ProcessNumber (string number)
{
if (number.IndexOf ('.') != -1 ||
number.IndexOf ('e') != -1 ||
number.IndexOf ('E') != -1) {
double n_double;
if (Double.TryParse (number, out n_double)) {
token = JsonToken.Double;
token_value = n_double;
return;
}
}
int n_int32;
if (Int32.TryParse (number, out n_int32)) {
token = JsonToken.Int;
token_value = n_int32;
return;
}
long n_int64;
if (Int64.TryParse (number, out n_int64)) {
token = JsonToken.Long;
token_value = n_int64;
return;
}
// Shouldn't happen, but just in case, return something
token = JsonToken.Int;
token_value = 0;
}
private void ProcessSymbol ()
{
if (current_symbol == '[') {
token = JsonToken.ArrayStart;
parser_return = true;
} else if (current_symbol == ']') {
token = JsonToken.ArrayEnd;
parser_return = true;
} else if (current_symbol == '{') {
token = JsonToken.ObjectStart;
parser_return = true;
} else if (current_symbol == '}') {
token = JsonToken.ObjectEnd;
parser_return = true;
} else if (current_symbol == '"') {
if (parser_in_string) {
parser_in_string = false;
parser_return = true;
} else {
if (token == JsonToken.None)
token = JsonToken.String;
parser_in_string = true;
}
} else if (current_symbol == (int) ParserToken.CharSeq) {
token_value = lexer.StringValue;
} else if (current_symbol == (int) ParserToken.False) {
token = JsonToken.Boolean;
token_value = false;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Null) {
token = JsonToken.Null;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Number) {
ProcessNumber (lexer.StringValue);
parser_return = true;
} else if (current_symbol == (int) ParserToken.Pair) {
token = JsonToken.PropertyName;
} else if (current_symbol == (int) ParserToken.True) {
token = JsonToken.Boolean;
token_value = true;
parser_return = true;
}
}
private bool ReadToken ()
{
if (end_of_input)
return false;
lexer.NextToken ();
if (lexer.EndOfInput) {
Close ();
return false;
}
current_input = lexer.Token;
return true;
}
#endregion
public void Close ()
{
if (end_of_input)
return;
end_of_input = true;
end_of_json = true;
if (reader_is_owned)
reader.Close ();
reader = null;
}
public bool Read ()
{
if (end_of_input)
return false;
if (end_of_json) {
end_of_json = false;
automaton_stack.Clear ();
automaton_stack.Push ((int) ParserToken.End);
automaton_stack.Push ((int) ParserToken.Text);
}
parser_in_string = false;
parser_return = false;
token = JsonToken.None;
token_value = null;
if (! read_started) {
read_started = true;
if (! ReadToken ())
return false;
}
int[] entry_symbols;
while (true) {
if (parser_return) {
if (automaton_stack.Peek () == (int) ParserToken.End)
end_of_json = true;
return true;
}
current_symbol = automaton_stack.Pop ();
ProcessSymbol ();
if (current_symbol == current_input) {
if (! ReadToken ()) {
if (automaton_stack.Peek () != (int) ParserToken.End)
throw new JsonException (
"Input doesn't evaluate to proper JSON text");
if (parser_return)
return true;
return false;
}
continue;
}
try {
entry_symbols =
parse_table[current_symbol][current_input];
} catch (KeyNotFoundException e) {
throw new JsonException ((ParserToken) current_input, e);
}
if (entry_symbols[0] == (int) ParserToken.Epsilon)
continue;
for (int i = entry_symbols.Length - 1; i >= 0; i--)
automaton_stack.Push (entry_symbols[i]);
}
}
}
}

463
Code/ClassLib/RoadFlow/LitJSON/JsonWriter.cs

@ -0,0 +1,463 @@
#region Header
/**
* JsonWriter.cs
* Stream-like facility to output JSON text.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace LitJson
{
internal enum Condition
{
InArray,
InObject,
NotAProperty,
Property,
Value
}
internal class WriterContext
{
public int Count;
public bool InArray;
public bool InObject;
public bool ExpectingValue;
public int Padding;
}
public class JsonWriter
{
#region Fields
private static NumberFormatInfo number_format;
private WriterContext context;
private Stack<WriterContext> ctx_stack;
private bool has_reached_end;
private char[] hex_seq;
private int indentation;
private int indent_value;
private StringBuilder inst_string_builder;
private bool pretty_print;
private bool validate;
private TextWriter writer;
#endregion
#region Properties
public int IndentValue {
get { return indent_value; }
set {
indentation = (indentation / indent_value) * value;
indent_value = value;
}
}
public bool PrettyPrint {
get { return pretty_print; }
set { pretty_print = value; }
}
public TextWriter TextWriter {
get { return writer; }
}
public bool Validate {
get { return validate; }
set { validate = value; }
}
#endregion
#region Constructors
static JsonWriter ()
{
number_format = NumberFormatInfo.InvariantInfo;
}
public JsonWriter ()
{
inst_string_builder = new StringBuilder ();
writer = new StringWriter (inst_string_builder);
Init ();
}
public JsonWriter (StringBuilder sb) :
this (new StringWriter (sb))
{
}
public JsonWriter (TextWriter writer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
this.writer = writer;
Init ();
}
#endregion
#region Private Methods
private void DoValidation (Condition cond)
{
if (! context.ExpectingValue)
context.Count++;
if (! validate)
return;
if (has_reached_end)
throw new JsonException (
"A complete JSON symbol has already been written");
switch (cond) {
case Condition.InArray:
if (! context.InArray)
throw new JsonException (
"Can't close an array here");
break;
case Condition.InObject:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't close an object here");
break;
case Condition.NotAProperty:
if (context.InObject && ! context.ExpectingValue)
throw new JsonException (
"Expected a property");
break;
case Condition.Property:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't add a property here");
break;
case Condition.Value:
if (! context.InArray &&
(! context.InObject || ! context.ExpectingValue))
throw new JsonException (
"Can't add a value here");
break;
}
}
private void Init ()
{
has_reached_end = false;
hex_seq = new char[4];
indentation = 0;
indent_value = 4;
pretty_print = false;
validate = true;
ctx_stack = new Stack<WriterContext> ();
context = new WriterContext ();
ctx_stack.Push (context);
}
private static void IntToHex (int n, char[] hex)
{
int num;
for (int i = 0; i < 4; i++) {
num = n % 16;
if (num < 10)
hex[3 - i] = (char) ('0' + num);
else
hex[3 - i] = (char) ('A' + (num - 10));
n >>= 4;
}
}
private void Indent ()
{
if (pretty_print)
indentation += indent_value;
}
private void Put (string str)
{
if (pretty_print && ! context.ExpectingValue)
for (int i = 0; i < indentation; i++)
writer.Write (' ');
writer.Write (str);
}
private void PutNewline ()
{
PutNewline (true);
}
private void PutNewline (bool add_comma)
{
if (add_comma && ! context.ExpectingValue &&
context.Count > 1)
writer.Write (',');
if (pretty_print && ! context.ExpectingValue)
writer.Write ('\n');
}
private void PutString (string str)
{
Put (String.Empty);
writer.Write ('"');
int n = str.Length;
for (int i = 0; i < n; i++) {
switch (str[i]) {
case '\n':
writer.Write ("\\n");
continue;
case '\r':
writer.Write ("\\r");
continue;
case '\t':
writer.Write ("\\t");
continue;
case '"':
case '\\':
writer.Write ('\\');
writer.Write (str[i]);
continue;
case '\f':
writer.Write ("\\f");
continue;
case '\b':
writer.Write ("\\b");
continue;
}
if ((int) str[i] >= 32 && (int) str[i] <= 126) {
writer.Write (str[i]);
continue;
}
// Default, turn into a \uXXXX sequence
IntToHex ((int) str[i], hex_seq);
writer.Write ("\\u");
writer.Write (hex_seq);
}
writer.Write ('"');
}
private void Unindent ()
{
if (pretty_print)
indentation -= indent_value;
}
#endregion
public override string ToString ()
{
if (inst_string_builder == null)
return String.Empty;
return inst_string_builder.ToString ();
}
public void Reset ()
{
has_reached_end = false;
ctx_stack.Clear ();
context = new WriterContext ();
ctx_stack.Push (context);
if (inst_string_builder != null)
inst_string_builder.Remove (0, inst_string_builder.Length);
}
public void Write (bool boolean)
{
DoValidation (Condition.Value);
PutNewline ();
Put (boolean ? "true" : "false");
context.ExpectingValue = false;
}
public void Write (decimal number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (double number)
{
DoValidation (Condition.Value);
PutNewline ();
string str = Convert.ToString (number, number_format);
Put (str);
if (str.IndexOf ('.') == -1 &&
str.IndexOf ('E') == -1)
writer.Write (".0");
context.ExpectingValue = false;
}
public void Write (int number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (long number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (string str)
{
DoValidation (Condition.Value);
PutNewline ();
if (str == null)
Put ("null");
else
PutString (str);
context.ExpectingValue = false;
}
[CLSCompliant(false)]
public void Write (ulong number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void WriteArrayEnd ()
{
DoValidation (Condition.InArray);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("]");
}
public void WriteArrayStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("[");
context = new WriterContext ();
context.InArray = true;
ctx_stack.Push (context);
Indent ();
}
public void WriteObjectEnd ()
{
DoValidation (Condition.InObject);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("}");
}
public void WriteObjectStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("{");
context = new WriterContext ();
context.InObject = true;
ctx_stack.Push (context);
Indent ();
}
public void WritePropertyName (string property_name)
{
DoValidation (Condition.Property);
PutNewline ();
PutString (property_name);
if (pretty_print) {
if (property_name.Length > context.Padding)
context.Padding = property_name.Length;
for (int i = context.Padding - property_name.Length;
i >= 0; i--)
writer.Write (' ');
writer.Write (": ");
} else
writer.Write (':');
context.ExpectingValue = true;
}
}
}

912
Code/ClassLib/RoadFlow/LitJSON/Lexer.cs

@ -0,0 +1,912 @@
#region Header
/**
* Lexer.cs
* JSON lexer implementation based on a finite state machine.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace LitJson
{
internal class FsmContext
{
public bool Return;
public int NextState;
public Lexer L;
public int StateStack;
}
internal class Lexer
{
#region Fields
private delegate bool StateHandler (FsmContext ctx);
private static int[] fsm_return_table;
private static StateHandler[] fsm_handler_table;
private bool allow_comments;
private bool allow_single_quoted_strings;
private bool end_of_input;
private FsmContext fsm_context;
private int input_buffer;
private int input_char;
private TextReader reader;
private int state;
private StringBuilder string_buffer;
private string string_value;
private int token;
private int unichar;
#endregion
#region Properties
public bool AllowComments {
get { return allow_comments; }
set { allow_comments = value; }
}
public bool AllowSingleQuotedStrings {
get { return allow_single_quoted_strings; }
set { allow_single_quoted_strings = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public int Token {
get { return token; }
}
public string StringValue {
get { return string_value; }
}
#endregion
#region Constructors
static Lexer ()
{
PopulateFsmTables ();
}
public Lexer (TextReader reader)
{
allow_comments = true;
allow_single_quoted_strings = true;
input_buffer = 0;
string_buffer = new StringBuilder (128);
state = 1;
end_of_input = false;
this.reader = reader;
fsm_context = new FsmContext ();
fsm_context.L = this;
}
#endregion
#region Static Methods
private static int HexValue (int digit)
{
switch (digit) {
case 'a':
case 'A':
return 10;
case 'b':
case 'B':
return 11;
case 'c':
case 'C':
return 12;
case 'd':
case 'D':
return 13;
case 'e':
case 'E':
return 14;
case 'f':
case 'F':
return 15;
default:
return digit - '0';
}
}
private static void PopulateFsmTables ()
{
// See section A.1. of the manual for details of the finite
// state machine.
fsm_handler_table = new StateHandler[28] {
State1,
State2,
State3,
State4,
State5,
State6,
State7,
State8,
State9,
State10,
State11,
State12,
State13,
State14,
State15,
State16,
State17,
State18,
State19,
State20,
State21,
State22,
State23,
State24,
State25,
State26,
State27,
State28
};
fsm_return_table = new int[28] {
(int) ParserToken.Char,
0,
(int) ParserToken.Number,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
0,
(int) ParserToken.True,
0,
0,
0,
(int) ParserToken.False,
0,
0,
(int) ParserToken.Null,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
0,
0
};
}
private static char ProcessEscChar (int esc_char)
{
switch (esc_char) {
case '"':
case '\'':
case '\\':
case '/':
return Convert.ToChar (esc_char);
case 'n':
return '\n';
case 't':
return '\t';
case 'r':
return '\r';
case 'b':
return '\b';
case 'f':
return '\f';
default:
// Unreachable
return '?';
}
}
private static bool State1 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r')
continue;
if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '"':
ctx.NextState = 19;
ctx.Return = true;
return true;
case ',':
case ':':
case '[':
case ']':
case '{':
case '}':
ctx.NextState = 1;
ctx.Return = true;
return true;
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 2;
return true;
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
case 'f':
ctx.NextState = 12;
return true;
case 'n':
ctx.NextState = 16;
return true;
case 't':
ctx.NextState = 9;
return true;
case '\'':
if (! ctx.L.allow_single_quoted_strings)
return false;
ctx.L.input_char = '"';
ctx.NextState = 23;
ctx.Return = true;
return true;
case '/':
if (! ctx.L.allow_comments)
return false;
ctx.NextState = 25;
return true;
default:
return false;
}
}
return true;
}
private static bool State2 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
default:
return false;
}
}
private static bool State3 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State4 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
private static bool State5 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 6;
return true;
}
return false;
}
private static bool State6 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State7 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
}
switch (ctx.L.input_char) {
case '+':
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
default:
return false;
}
}
private static bool State8 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
return true;
}
private static bool State9 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'r':
ctx.NextState = 10;
return true;
default:
return false;
}
}
private static bool State10 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 11;
return true;
default:
return false;
}
}
private static bool State11 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State12 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'a':
ctx.NextState = 13;
return true;
default:
return false;
}
}
private static bool State13 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 14;
return true;
default:
return false;
}
}
private static bool State14 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 's':
ctx.NextState = 15;
return true;
default:
return false;
}
}
private static bool State15 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State16 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 17;
return true;
default:
return false;
}
}
private static bool State17 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 18;
return true;
default:
return false;
}
}
private static bool State18 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State19 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '"':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 20;
return true;
case '\\':
ctx.StateStack = 19;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State20 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '"':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State21 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 22;
return true;
case '"':
case '\'':
case '/':
case '\\':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
ctx.L.string_buffer.Append (
ProcessEscChar (ctx.L.input_char));
ctx.NextState = ctx.StateStack;
return true;
default:
return false;
}
}
private static bool State22 (FsmContext ctx)
{
int counter = 0;
int mult = 4096;
ctx.L.unichar = 0;
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' ||
ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' ||
ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') {
ctx.L.unichar += HexValue (ctx.L.input_char) * mult;
counter++;
mult /= 16;
if (counter == 4) {
ctx.L.string_buffer.Append (
Convert.ToChar (ctx.L.unichar));
ctx.NextState = ctx.StateStack;
return true;
}
continue;
}
return false;
}
return true;
}
private static bool State23 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '\'':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 24;
return true;
case '\\':
ctx.StateStack = 23;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State24 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '\'':
ctx.L.input_char = '"';
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State25 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '*':
ctx.NextState = 27;
return true;
case '/':
ctx.NextState = 26;
return true;
default:
return false;
}
}
private static bool State26 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '\n') {
ctx.NextState = 1;
return true;
}
}
return true;
}
private static bool State27 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*') {
ctx.NextState = 28;
return true;
}
}
return true;
}
private static bool State28 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*')
continue;
if (ctx.L.input_char == '/') {
ctx.NextState = 1;
return true;
}
ctx.NextState = 27;
return true;
}
return true;
}
#endregion
private bool GetChar ()
{
if ((input_char = NextChar ()) != -1)
return true;
end_of_input = true;
return false;
}
private int NextChar ()
{
if (input_buffer != 0) {
int tmp = input_buffer;
input_buffer = 0;
return tmp;
}
return reader.Read ();
}
public bool NextToken ()
{
StateHandler handler;
fsm_context.Return = false;
while (true) {
handler = fsm_handler_table[state - 1];
if (! handler (fsm_context))
throw new JsonException (input_char);
if (end_of_input)
return false;
if (fsm_context.Return) {
string_value = string_buffer.ToString ();
string_buffer.Remove (0, string_buffer.Length);
token = fsm_return_table[state - 1];
if (token == (int) ParserToken.Char)
token = input_char;
state = fsm_context.NextState;
return true;
}
state = fsm_context.NextState;
}
}
private void UngetChar ()
{
input_buffer = input_char;
}
}
}

73
Code/ClassLib/RoadFlow/LitJSON/LitJSON.csproj

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{28D9F7BA-2923-4364-9BEA-9E1CCD70DD22}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LitJSON</RootNamespace>
<AssemblyName>LitJSON</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="IJsonWrapper.cs" />
<Compile Include="JsonData.cs" />
<Compile Include="JsonException.cs" />
<Compile Include="JsonMapper.cs" />
<Compile Include="JsonMockWrapper.cs" />
<Compile Include="JsonReader.cs" />
<Compile Include="JsonWriter.cs" />
<Compile Include="Lexer.cs" />
<Compile Include="ParserToken.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

44
Code/ClassLib/RoadFlow/LitJSON/ParserToken.cs

@ -0,0 +1,44 @@
#region Header
/**
* ParserToken.cs
* Internal representation of the tokens used by the lexer and the parser.
*
* The authors disclaim copyright to this source code. For more details, see
* the COPYING file included with this distribution.
**/
#endregion
namespace LitJson
{
internal enum ParserToken
{
// Lexer tokens (see section A.1.1. of the manual)
None = System.Char.MaxValue + 1,
Number,
True,
False,
Null,
CharSeq,
// Single char
Char,
// Parser Rules (see section A.2.1 of the manual)
Text,
Object,
ObjectPrime,
Pair,
PairRest,
Array,
ArrayPrime,
Value,
ValueRest,
String,
// End of input
End,
// The empty rule
Epsilon
}
}

36
Code/ClassLib/RoadFlow/LitJSON/Properties/AssemblyInfo.cs

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

2
Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/.gitignore

@ -0,0 +1,2 @@
obj
bin

15
Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/Cache.cs

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Cache.Factory
{
public class Cache
{
public static Interface.ICache CreateInstance()
{
return new RoadFlow.Cache.InProc.Cache();
}
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/Properties/AssemblyInfo.cs

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

77
Code/ClassLib/RoadFlow/RoadFlow.Cache.Factory/RoadFlow.Cache.Factory.csproj

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1E605362-7767-45F9-9BC1-F8E495FA3F4E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Cache.Factory</RootNamespace>
<AssemblyName>RoadFlow.Cache.Factory</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>0168;</NoWarn>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="Cache.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoadFlow.Cache.InProc\RoadFlow.Cache.InProc.csproj">
<Project>{85CE9C4B-0E05-4951-83C0-BBB65F43DF28}</Project>
<Name>RoadFlow.Cache.InProc</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.Interface\RoadFlow.Cache.Interface.csproj">
<Project>{C3F609A8-6A7B-4BFF-9E21-02B785AD4F20}</Project>
<Name>RoadFlow.Cache.Interface</Name>
</ProjectReference>
</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>

2
Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/.gitignore

@ -0,0 +1,2 @@
bin
obj

77
Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/Cache.cs

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Cache.IO
{
public class Opation
{
private static Interface.ICache myCache = Factory.Cache.CreateInstance();
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static bool Insert(string key, object obj)
{
return myCache.Insert(key, obj);
}
/// <summary>
/// 设置缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static bool Set(string key, object obj)
{
return Insert(key, obj);
}
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static bool Insert(string key, object obj, DateTime expiry)
{
return myCache.Insert(key, obj, expiry);
}
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static bool Set(string key, object obj, DateTime expiry)
{
return Insert(key, obj, expiry);
}
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static object Get(string key)
{
return myCache.Get(key);
}
/// <summary>
/// 移出缓存
/// </summary>
/// <param name="key"></param>
public static bool Remove(string key)
{
return myCache.Remove(key);
}
/// <summary>
/// 清空所有缓存
/// </summary>
/// <returns></returns>
public static void RemoveAll()
{
myCache.RemoveAll();
}
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/Properties/AssemblyInfo.cs

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

77
Code/ClassLib/RoadFlow/RoadFlow.Cache.IO/RoadFlow.Cache.IO.csproj

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{41C4C5A0-0CF3-4E8F-9339-1F557C6D5A0F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Cache.IO</RootNamespace>
<AssemblyName>RoadFlow.Cache.IO</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>0168;</NoWarn>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="Cache.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoadFlow.Cache.Factory\RoadFlow.Cache.Factory.csproj">
<Project>{1E605362-7767-45F9-9BC1-F8E495FA3F4E}</Project>
<Name>RoadFlow.Cache.Factory</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.Interface\RoadFlow.Cache.Interface.csproj">
<Project>{C3F609A8-6A7B-4BFF-9E21-02B785AD4F20}</Project>
<Name>RoadFlow.Cache.Interface</Name>
</ProjectReference>
</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>

2
Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/.gitignore

@ -0,0 +1,2 @@
bin
obj

82
Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/Cache.cs

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Caching;
namespace RoadFlow.Cache.InProc
{
/// <summary>
/// .net自带缓存类
/// </summary>
public class Cache : Interface.ICache
{
public static object LockObject = new object();
private System.Web.Caching.Cache cache = HttpContext.Current.Cache;
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public bool Insert(string key, object obj)
{
if (obj == null) return false;
lock (LockObject)
{
cache.Insert(key, obj, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration);
}
return true;
}
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
public bool Insert(string key, object obj, DateTime expiry)
{
if (obj == null) return false;
lock (LockObject)
{
cache.Insert(key, obj, null, expiry, System.Web.Caching.Cache.NoSlidingExpiration,
System.Web.Caching.CacheItemPriority.Normal, null);
}
return true;
}
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public object Get(string key)
{
return cache.Get(key);
}
/// <summary>
/// 移出缓存
/// </summary>
/// <param name="key"></param>
public bool Remove(string key)
{
object lockObj = new object();
lock (lockObj)
{
cache.Remove(key);
}
return true;
}
/// <summary>
/// 移出所有缓存
/// </summary>
/// <returns></returns>
public void RemoveAll()
{
for (int i = 0; i < cache.Count; i++)
{
}
}
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/Properties/AssemblyInfo.cs

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

74
Code/ClassLib/RoadFlow/RoadFlow.Cache.InProc/RoadFlow.Cache.InProc.csproj

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{85CE9C4B-0E05-4951-83C0-BBB65F43DF28}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Cache.InProc</RootNamespace>
<AssemblyName>RoadFlow.Cache.InProc</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>0168;</NoWarn>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<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="Cache.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoadFlow.Cache.Interface\RoadFlow.Cache.Interface.csproj">
<Project>{C3F609A8-6A7B-4BFF-9E21-02B785AD4F20}</Project>
<Name>RoadFlow.Cache.Interface</Name>
</ProjectReference>
</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>

2
Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/.gitignore

@ -0,0 +1,2 @@
bin
obj

42
Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/ICache.cs

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Cache.Interface
{
public interface ICache
{
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
bool Insert(string key, object obj);
/// <summary>
/// 插入缓存
/// </summary>
/// <param name="key"></param>
/// <param name="obj"></param>
/// <returns></returns>
bool Insert(string key, object obj, DateTime expiry);
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
object Get(string key);
/// <summary>
/// 移出缓存
/// </summary>
/// <param name="key"></param>
bool Remove(string key);
/// <summary>
/// 移出所有缓存
/// </summary>
/// <returns></returns>
void RemoveAll();
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/Properties/AssemblyInfo.cs

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

67
Code/ClassLib/RoadFlow/RoadFlow.Cache.Interface/RoadFlow.Cache.Interface.csproj

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C3F609A8-6A7B-4BFF-9E21-02B785AD4F20}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Cache.Interface</RootNamespace>
<AssemblyName>RoadFlow.Cache.Interface</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
<NoWarn>0168;</NoWarn>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="ICache.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>

2
Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/.gitignore

@ -0,0 +1,2 @@
bin
obj

255
Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/Factory.cs

@ -0,0 +1,255 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace RoadFlow.Data.Factory
{
public class Factory
{
/*
private static string dataType = RoadFlow.Utility.Config.DataBaseType;
private static string cacheKey = RoadFlow.Utility.Keys.CacheKeys.ClassInstance_.ToString();
public static object CreateInstance(string className)
{
string cacheKey1 = cacheKey + className;
string typeName = "RoadFlow.Data." + dataType + "." + className;
object obj = RoadFlow.Cache.IO.Opation.Get(cacheKey1);
if (obj == null)
{
Type type = Assembly.Load("RoadFlow.Data." + dataType).GetType(typeName, true);
obj = Activator.CreateInstance(type);
RoadFlow.Cache.IO.Opation.Set(cacheKey1, obj);
return obj;
}
else
{
return obj;
}
}
*/
#region MSSQL
/*
public static Data.Interface.IAppLibrary GetAppLibrary()
{
return new Data.MSSQL.AppLibrary();
}
public static Data.Interface.IDBConnection GetDBConnection()
{
return new Data.MSSQL.DBConnection();
}
public static Data.Interface.IDictionary GetDictionary()
{
return new Data.MSSQL.Dictionary();
}
public static Data.Interface.ILog GetLog()
{
return new Data.MSSQL.Log();
}
public static Data.Interface.IOrganize GetOrganize()
{
return new Data.MSSQL.Organize();
}
public static Data.Interface.IRole GetRole()
{
return new Data.MSSQL.Role();
}
public static Data.Interface.IRoleApp GetRoleApp()
{
return new Data.MSSQL.RoleApp();
}
public static Data.Interface.IUsers GetUsers()
{
return new Data.MSSQL.Users();
}
public static Data.Interface.IUsersApp GetUsersApp()
{
return new Data.MSSQL.UsersApp();
}
public static Data.Interface.IUsersInfo GetUsersInfo()
{
return new Data.MSSQL.UsersInfo();
}
public static Data.Interface.IUsersRelation GetUsersRelation()
{
return new Data.MSSQL.UsersRelation();
}
public static Data.Interface.IUsersRole GetUsersRole()
{
return new Data.MSSQL.UsersRole();
}
public static Data.Interface.IWorkFlow GetWorkFlow()
{
return new Data.MSSQL.WorkFlow();
}
public static Data.Interface.IWorkFlowArchives GetWorkFlowArchives()
{
return new Data.MSSQL.WorkFlowArchives();
}
public static Data.Interface.IWorkFlowButtons GetWorkFlowButtons()
{
return new Data.MSSQL.WorkFlowButtons();
}
public static Data.Interface.IWorkFlowComment GetWorkFlowComment()
{
return new Data.MSSQL.WorkFlowComment();
}
public static Data.Interface.IWorkFlowData GetWorkFlowData()
{
return new Data.MSSQL.WorkFlowData();
}
public static Data.Interface.IWorkFlowDelegation GetWorkFlowDelegation()
{
return new Data.MSSQL.WorkFlowDelegation();
}
public static Data.Interface.IWorkFlowForm GetWorkFlowForm()
{
return new Data.MSSQL.WorkFlowForm();
}
public static Data.Interface.IWorkFlowTask GetWorkFlowTask()
{
return new Data.MSSQL.WorkFlowTask();
}
public static Data.Interface.IWorkGroup GetWorkGroup()
{
return new Data.MSSQL.WorkGroup();
}
*/
#endregion
#region ORACLE
public static Data.Interface.IAppLibrary GetAppLibrary()
{
return new Data.ORACLE.AppLibrary();
}
public static Data.Interface.IDBConnection GetDBConnection()
{
return new Data.ORACLE.DBConnection();
}
public static Data.Interface.IDictionary GetDictionary()
{
return new Data.ORACLE.Dictionary();
}
public static Data.Interface.ILog GetLog()
{
return new Data.ORACLE.Log();
}
public static Data.Interface.IOrganize GetOrganize()
{
return new Data.ORACLE.Organize();
}
public static Data.Interface.IRole GetRole()
{
return new Data.ORACLE.Role();
}
public static Data.Interface.IRoleApp GetRoleApp()
{
return new Data.ORACLE.RoleApp();
}
public static Data.Interface.IUsers GetUsers()
{
return new Data.ORACLE.Users();
}
public static Data.Interface.IUsersApp GetUsersApp()
{
return new Data.ORACLE.UsersApp();
}
public static Data.Interface.IUsersInfo GetUsersInfo()
{
return new Data.ORACLE.UsersInfo();
}
public static Data.Interface.IUsersRelation GetUsersRelation()
{
return new Data.ORACLE.UsersRelation();
}
public static Data.Interface.IUsersRole GetUsersRole()
{
return new Data.ORACLE.UsersRole();
}
public static Data.Interface.IWorkFlow GetWorkFlow()
{
return new Data.ORACLE.WorkFlow();
}
public static Data.Interface.IWorkFlowArchives GetWorkFlowArchives()
{
return new Data.ORACLE.WorkFlowArchives();
}
public static Data.Interface.IWorkFlowButtons GetWorkFlowButtons()
{
return new Data.ORACLE.WorkFlowButtons();
}
public static Data.Interface.IWorkFlowComment GetWorkFlowComment()
{
return new Data.ORACLE.WorkFlowComment();
}
public static Data.Interface.IWorkFlowData GetWorkFlowData()
{
return new Data.ORACLE.WorkFlowData();
}
public static Data.Interface.IWorkFlowDelegation GetWorkFlowDelegation()
{
return new Data.ORACLE.WorkFlowDelegation();
}
public static Data.Interface.IWorkFlowForm GetWorkFlowForm()
{
return new Data.ORACLE.WorkFlowForm();
}
public static Data.Interface.IWorkFlowTask GetWorkFlowTask()
{
return new Data.ORACLE.WorkFlowTask();
}
public static Data.Interface.IWorkGroup GetWorkGroup()
{
return new Data.ORACLE.WorkGroup();
}
#endregion
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/Properties/AssemblyInfo.cs

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

103
Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/RoadFlow.Data.Factory.csproj

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C34A6499-929A-4F0E-B1BA-2A6A9734888E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Data.Factory</RootNamespace>
<AssemblyName>RoadFlow.Data.Factory</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="Factory.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoadFlow.Data.Interface\RoadFlow.Data.Interface.csproj">
<Project>{7F7EC855-EE2F-4EF5-861B-DA945961C1A2}</Project>
<Name>RoadFlow.Data.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.Factory\RoadFlow.Cache.Factory.csproj">
<Project>{1e605362-7767-45f9-9bc1-f8e495fa3f4e}</Project>
<Name>RoadFlow.Cache.Factory</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.InProc\RoadFlow.Cache.InProc.csproj">
<Project>{85ce9c4b-0e05-4951-83c0-bbb65f43df28}</Project>
<Name>RoadFlow.Cache.InProc</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.Interface\RoadFlow.Cache.Interface.csproj">
<Project>{c3f609a8-6a7b-4bff-9e21-02b785ad4f20}</Project>
<Name>RoadFlow.Cache.Interface</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Cache.IO\RoadFlow.Cache.IO.csproj">
<Project>{41c4c5a0-0cf3-4e8f-9339-1f557c6d5a0f}</Project>
<Name>RoadFlow.Cache.IO</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Data.Model\RoadFlow.Data.Model.csproj">
<Project>{75fb2c86-f7d3-4e94-82e9-46dd9787b39d}</Project>
<Name>RoadFlow.Data.Model</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Data.ORACLE\RoadFlow.Data.ORACLE.csproj">
<Project>{efcd6a7c-c598-4bbd-bdc6-3016aaabd26c}</Project>
<Name>RoadFlow.Data.ORACLE</Name>
</ProjectReference>
<ProjectReference Include="..\RoadFlow.Utility\RoadFlow.Utility.csproj">
<Project>{ce3b0adb-736e-4a7b-bede-801c9104f95e}</Project>
<Name>RoadFlow.Utility</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</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>

15
Code/ClassLib/RoadFlow/RoadFlow.Data.Factory/app.config

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

2
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/.gitignore

@ -0,0 +1,2 @@
bin
obj

54
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IAppLibrary.cs

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IAppLibrary
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.AppLibrary model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.AppLibrary model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.AppLibrary> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.AppLibrary Get(string id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个类别下所有记录
/// </summary>
List<RoadFlow.Data.Model.AppLibrary> GetAllByType(string type);
/// <summary>
/// 删除记录
/// </summary>
int Delete(string[] idArray);
/// <summary>
/// 根据代码查询一条记录
/// </summary>
RoadFlow.Data.Model.AppLibrary GetByCode(string code);
}
}

38
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IDBConnection.cs

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IDBConnection
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.DBConnection model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.DBConnection model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.DBConnection> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.DBConnection Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IDictionary.cs

@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IDictionary
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.Dictionary model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.Dictionary model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.Dictionary> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.Dictionary Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 根据父ID查询一条记录
/// </summary>
RoadFlow.Data.Model.Dictionary GetRoot(Guid id);
/// <summary>
/// 查询根记录
/// </summary>
RoadFlow.Data.Model.Dictionary GetRoot();
/// <summary>
/// 查询下级记录
/// </summary>
List<RoadFlow.Data.Model.Dictionary> GetChilds(Guid id);
/// <summary>
/// 查询下级记录
/// </summary>
List<RoadFlow.Data.Model.Dictionary> GetChilds(string code);
/// <summary>
/// 查询上级记录
/// </summary>
RoadFlow.Data.Model.Dictionary GetParent(Guid id);
/// <summary>
/// 是否包含下级记录
/// </summary>
bool HasChilds(Guid id);
/// <summary>
/// 得到最大排序
/// </summary>
int GetMaxSort(Guid id);
/// <summary>
/// 更新排序
/// </summary>
int UpdateSort(Guid id, int sort);
/// <summary>
/// 根据代码查询一条记录
/// </summary>
RoadFlow.Data.Model.Dictionary GetByCode(string code);
}
}

54
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/ILog.cs

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface ILog
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.Log model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.Log model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.Log> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.Log Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 得到一页日志数据
/// </summary>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="order"></param>
/// <param name="size"></param>
/// <param name="number"></param>
/// <param name="title"></param>
/// <param name="type"></param>
/// <param name="date1"></param>
/// <param name="date2"></param>
/// <param name="userID"></param>
/// <returns></returns>
System.Data.DataTable GetPagerData(out string pager, string query = "", int size = 15, int number = 1, string title = "", string type = "", string date1 = "", string date2 = "", string userID = "");
}
}

79
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IOrganize.cs

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IOrganize
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.Organize model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.Organize model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.Organize> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.Organize Get(string id);
/// <summary>
/// 删除
/// </summary>
int Delete(string id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 根据根记录
/// </summary>
RoadFlow.Data.Model.Organize GetRoot();
/// <summary>
/// 查询下级记录
/// </summary>
List<RoadFlow.Data.Model.Organize> GetChilds(string ID);
/// <summary>
/// 得到最大排序值
/// </summary>
/// <returns></returns>
int GetMaxSort(Guid id);
/// <summary>
/// 更新下级数
/// </summary>
/// <returns></returns>
int UpdateChildsLength(string id, int length);
/// <summary>
/// 更新排序
/// </summary>
/// <returns></returns>
int UpdateSort(Guid id, int sort);
/// <summary>
/// 查询一个组织的所有上级
/// </summary>
List<RoadFlow.Data.Model.Organize> GetAllParent(string number);
/// <summary>
/// 查询一个组织的所有下级
/// </summary>
/// <param name="number">编号</param>
/// <returns></returns>
List<RoadFlow.Data.Model.Organize> GetAllChild(string number);
}
}

38
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IRole.cs

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IRole
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.Role model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.Role model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.Role> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.Role Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
}
}

90
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IRoleApp.cs

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IRoleApp
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.RoleApp model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.RoleApp model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.RoleApp> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.RoleApp Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个角色所有记录
/// </summary>
List<RoadFlow.Data.Model.RoleApp> GetAllByRoleID(Guid roleID);
/// <summary>
/// 查询个角色所有记录
/// </summary>
System.Data.DataTable GetAllDataTableByRoleID(Guid roleID);
/// <summary>
/// 查询所有记录
/// </summary>
System.Data.DataTable GetAllDataTable();
/// <summary>
/// 查询所有下级记录
/// </summary>
System.Data.DataTable GetChildsDataTable(Guid id);
/// <summary>
/// 查询下级记录
/// </summary>
List<RoadFlow.Data.Model.RoleApp> GetChild(Guid id);
/// <summary>
/// 是否有下级记录
/// </summary>
bool HasChild(Guid id);
/// <summary>
/// 更新排序
/// </summary>
int UpdateSort(Guid id, int sort);
/// <summary>
/// 删除一个角色记录
/// </summary>
int DeleteByRoleID(Guid roleID);
/// <summary>
/// 得到最大排序值
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
int GetMaxSort(Guid id);
/// <summary>
/// 删除一个应用记录
/// </summary>
int DeleteByAppID(string appID);
}
}

78
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsers.cs

@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IUsers
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.Users model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.Users model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.Users> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.Users Get(string id);
/// <summary>
/// 删除
/// </summary>
int Delete(string id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 根据帐号查询一条记录
/// </summary>
RoadFlow.Data.Model.Users GetByAccount2(string Account2);
/// <summary>
/// 查询一个岗位下所有人员
/// </summary>
/// <param name="organizeID"></param>
/// <returns></returns>
List<Model.Users> GetAllByOrganizeID(string organizeID);
/// <summary>
/// 查询一组岗位下所有人员
/// </summary>
/// <param name="organizeID"></param>
/// <returns></returns>
List<Model.Users> GetAllByOrganizeIDArray(string[] organizeIDArray);
/// <summary>
/// 检查帐号是否重复
/// </summary>
/// <param name="Account2">帐号</param>
/// <param name="userID">人员ID(此人员除外)</param>
/// <returns></returns>
bool HasAccount2(string Account2, string userID = "");
/// <summary>
/// 修改用户密码
/// </summary>
/// <param name="password"></param>
/// <param name="userID"></param>
/// <returns></returns>
bool UpdatePassword(string password, Guid userID);
/// <summary>
/// 更新排序
/// </summary>
int UpdateSort(Guid userID, int sort);
}
}

58
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersApp.cs

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IUsersApp
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.UsersApp model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.UsersApp model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersApp> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.UsersApp Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(string id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询所有记录
/// </summary>
System.Data.DataTable GetAllDataTable();
/// <summary>
/// 更新排序
/// </summary>
int UpdateSort(Guid id, int sort);
/// <summary>
/// 查询下级记录
/// </summary>
List<RoadFlow.Data.Model.UsersApp> GetChild(string id);
/// <summary>
/// 删除一个用户记录
/// </summary>
int DeleteByUserID(Guid userID);
}
}

38
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersInfo.cs

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IUsersInfo
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.UsersInfo model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.UsersInfo model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersInfo> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.UsersInfo Get(Guid userid);
/// <summary>
/// 删除
/// </summary>
int Delete(string userid);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
}
}

74
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersRelation.cs

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IUsersRelation
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.UsersRelation model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.UsersRelation model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersRelation> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.UsersRelation Get(Guid userid, Guid organizeid);
/// <summary>
/// 删除
/// </summary>
int Delete(string userid, string organizeid);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个岗位下所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersRelation> GetAllByOrganizeID(string organizeID);
/// <summary>
/// 查询一个用户所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersRelation> GetAllByUserID(string userID);
/// <summary>
/// 查询一个用户主要岗位
/// </summary>
RoadFlow.Data.Model.UsersRelation GetMainByUserID(string userID);
/// <summary>
/// 删除一个用户记录
/// </summary>
int DeleteByUserID(Guid userID);
/// <summary>
/// 删除一个用户的兼职记录
/// </summary>
int DeleteNotIsMainByUserID(Guid userID);
/// <summary>
/// 删除一个机构下所有记录
/// </summary>
int DeleteByOrganizeID(Guid organizeID);
/// <summary>
/// 得到最大排序值
/// </summary>
/// <returns></returns>
int GetMaxSort(Guid organizeID);
}
}

58
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IUsersRole.cs

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IUsersRole
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.UsersRole model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.UsersRole model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.UsersRole> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.UsersRole Get(Guid memberid, Guid roleid);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid memberid, Guid roleid);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 删除一个机构所有记录
/// </summary>
int DeleteByUserID(string userID);
/// <summary>
/// 删除一个角色所有记录
/// </summary>
int DeleteByRoleID(Guid roleid);
/// <summary>
/// 根据一组机构ID查询记录
/// </summary>
List<RoadFlow.Data.Model.UsersRole> GetByUserIDArray(Guid[] userIDArray);
/// <summary>
/// 根据人员ID查询记录
/// </summary>
List<RoadFlow.Data.Model.UsersRole> GetByUserID(string userID);
}
}

53
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlow.cs

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlow
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlow model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlow model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlow> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlow Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询所有类型
/// </summary>
List<string> GetAllTypes();
/// <summary>
/// 查询所有ID和名称
/// </summary>
Dictionary<Guid, string> GetAllIDAndName();
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlow> GetByTypes(string typeString);
}
}

48
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowArchives.cs

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowArchives
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowArchives model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowArchives model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowArchives> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowArchives Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 得到一页数据
/// </summary>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="title"></param>
/// <param name="flowIDString"></param>
/// <returns></returns>
System.Data.DataTable GetPagerData(out string pager, string query = "", string title = "", string flowIDString = "");
}
}

43
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowButtons.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowButtons
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowButtons model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowButtons model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowButtons> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowButtons Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询最大排序
/// </summary>
int GetMaxSort();
}
}

55
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowComment.cs

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowComment
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowComment model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowComment model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowComment> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowComment Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询管理员的所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowComment> GetManagerAll();
/// <summary>
/// 得到管理员类别的最大排序值
/// </summary>
/// <returns></returns>
int GetManagerMaxSort();
/// <summary>
/// 得到一个人员的最大排序值
/// </summary>
/// <returns></returns>
int GetUserMaxSort(Guid userID);
}
}

43
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowData.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowData
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowData model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowData model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowData> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowData Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个实例ID所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowData> GetAll(Guid instanceID);
}
}

59
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowDelegation.cs

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowDelegation
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowDelegation model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowDelegation model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowDelegation> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowDelegation Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个用户所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowDelegation> GetByUserID(Guid userID);
/// <summary>
/// 得到一页数据
/// </summary>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="userID"></param>
/// <param name="startTime"></param>
/// <param name="endTime"></param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowDelegation> GetPagerData(out string pager, string query = "", string userID = "", string startTime = "", string endTime = "");
/// <summary>
/// 得到未过期的委托
/// </summary>
List<RoadFlow.Data.Model.WorkFlowDelegation> GetNoExpiredList();
}
}

43
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowForm.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowForm
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowForm model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowForm model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowForm> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowForm Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询一个分类所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowForm> GetAllByType(string types);
}
}

235
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkFlowTask.cs

@ -0,0 +1,235 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkFlowTask
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkFlowTask model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkFlowTask model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkFlowTask> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkFlowTask Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 删除一个实例
/// </summary>
int Delete(Guid flowID, Guid groupID);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
/// <summary>
/// 查询待办任务
/// </summary>
/// <param name="userID"></param>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="title"></param>
/// <param name="flowid"></param>
/// <param name="date1"></param>
/// <param name="date2"></param>
/// <param name="type">0待办 1已完成</param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowTask> GetTasks(string userID, out string pager, string query = "", string title = "", string flowid = "", string sender = "", string date1 = "", string date2 = "", int type = 0);
/// <summary>
/// 查询待办任务(APP接口)
/// </summary>
/// <param name="userID"></param>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="title"></param>
/// <param name="flowid"></param>
/// <param name="date1"></param>
/// <param name="date2"></param>
/// <param name="type">0待办 1已完成</param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowTask> AppGetTasks(string userID, int PageIndex, int PageSize, string title = "", string flowid = "", string sender = "", string date1 = "", string date2 = "", int type = 0);
/// <summary>
/// 得到流程实例列表
/// </summary>
/// <param name="flowID"></param>
/// <param name="senderID"></param>
/// <param name="receiveID"></param>
/// <param name="pager"></param>
/// <param name="query"></param>
/// <param name="title"></param>
/// <param name="flowid"></param>
/// <param name="date1"></param>
/// <param name="date2"></param>
/// <param name="status">是否完成 0:全部 1:未完成 2:已完成</param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowTask> GetInstances(Guid[] flowID, Guid[] senderID, Guid[] receiveID, out string pager, string query = "", string title = "", string flowid = "", string date1 = "", string date2 = "", int status = 0);
/// <summary>
/// 更新打开时间
/// </summary>
/// <param name="id"></param>
/// <param name="openTime"></param>
/// <param name="isStatus">是否将状态更新为1</param>
void UpdateOpenTime(Guid id, DateTime openTime, bool isStatus = false);
/// <summary>
/// 得到一个流程实例的发起者
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
string GetFirstSnderID(Guid flowID, string groupID);
/// <summary>
/// 得到一个流程实例一个步骤的处理者
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<Guid> GetStepSnderID(Guid flowID, Guid stepID, Guid groupID);
/// <summary>
/// 得到一个流程实例前一步骤的处理者
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<Guid> GetPrevSnderID(Guid flowID, Guid stepID, Guid groupID);
/// <summary>
/// 完成一个任务
/// </summary>
/// <param name="taskID"></param>
/// <param name="comment"></param>
/// <param name="isSign"></param>
/// <returns></returns>
int Completed(Guid taskID, string comment = "", bool isSign = false, int status = 2, string note = "");
/// <summary>
/// 得到一个流程实例一个步骤的任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<Model.WorkFlowTask> GetTaskList(Guid flowID, Guid stepID, Guid groupID);
/// <summary>
/// 得到一个实例的任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowTask> GetTaskList(Guid flowID, Guid groupID);
/// <summary>
/// 得到和一个任务同级的任务
/// </summary>
/// <param name="taskID">任务ID</param>
/// <param name="isStepID">是否区分步骤ID,多步骤会签区分的是上一步骤ID</param>
/// <returns></returns>
List<RoadFlow.Data.Model.WorkFlowTask> GetTaskList(Guid taskID, bool isStepID = true);
/// <summary>
/// 得到一个任务的前一任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<Model.WorkFlowTask> GetPrevTaskList(Guid taskID);
/// <summary>
/// 得到一个任务的后续任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="groupID"></param>
/// <returns></returns>
List<Model.WorkFlowTask> GetNextTaskList(Guid taskID);
/// <summary>
/// 得到一个流程实例一个步骤一个人员的任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="stepID"></param>
/// <param name="groupID"></param>
/// <param name="userID"></param>
/// <returns></returns>
List<Model.WorkFlowTask> GetUserTaskList(Guid flowID, Guid stepID, Guid groupID, Guid userID);
/// <summary>
/// 更新一个任务后后续任务状态
/// </summary>
/// <param name="taskID"></param>
/// <param name="comment"></param>
/// <param name="isSign"></param>
/// <returns></returns>
int UpdateNextTaskStatus(Guid taskID, int status);
/// <summary>
/// 查询一个流程是否有任务数据
/// </summary>
/// <param name="flowID"></param>
/// <returns></returns>
bool HasTasks(Guid flowID);
/// <summary>
/// 查询一个用户在一个步骤是否有未完成任务
/// </summary>
/// <param name="flowID"></param>
/// <returns></returns>
bool HasNoCompletedTasks(Guid flowID, Guid stepID, Guid groupID, string userID);
/// <summary>
/// 激活临时任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="stepID"></param>
/// <param name="groupID"></param>
/// <param name="completedTime">要求完成时间</param>
/// <returns></returns>
int UpdateTempTasks(Guid flowID, Guid stepID, Guid groupID, DateTime? completedTime, DateTime receiveTime);
/// <summary>
/// 删除临时任务
/// </summary>
/// <param name="flowID"></param>
/// <param name="stepID"></param>
/// <param name="groupID"></param>
/// <param name="prevStepID"></param>
/// <returns></returns>
int DeleteTempTasks(Guid flowID, Guid stepID, Guid groupID, Guid prevStepID);
/// <summary>
/// 得到一个任务的状态
/// </summary>
/// <param name="taskID"></param>
/// <returns></returns>
int GetTaskStatus(Guid taskID);
/// <summary>
/// 根据SubFlowID得到一个任务
/// </summary>
/// <param name="subflowGroupID"></param>
/// <returns></returns>
List<Model.WorkFlowTask> GetBySubFlowGroupID(Guid subflowGroupID);
}
}

38
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/IWorkGroup.cs

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
namespace RoadFlow.Data.Interface
{
public interface IWorkGroup
{
/// <summary>
/// 新增
/// </summary>
int Add(RoadFlow.Data.Model.WorkGroup model);
/// <summary>
/// 更新
/// </summary>
int Update(RoadFlow.Data.Model.WorkGroup model);
/// <summary>
/// 查询所有记录
/// </summary>
List<RoadFlow.Data.Model.WorkGroup> GetAll();
/// <summary>
/// 查询单条记录
/// </summary>
Model.WorkGroup Get(Guid id);
/// <summary>
/// 删除
/// </summary>
int Delete(Guid id);
/// <summary>
/// 查询记录条数
/// </summary>
long GetCount();
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/Properties/AssemblyInfo.cs

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

92
Code/ClassLib/RoadFlow/RoadFlow.Data.Interface/RoadFlow.Data.Interface.csproj

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7F7EC855-EE2F-4EF5-861B-DA945961C1A2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Data.Interface</RootNamespace>
<AssemblyName>RoadFlow.Data.Interface</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="IAppLibrary.cs" />
<Compile Include="IDBConnection.cs" />
<Compile Include="IDictionary.cs" />
<Compile Include="ILog.cs" />
<Compile Include="IOrganize.cs" />
<Compile Include="IRole.cs" />
<Compile Include="IRoleApp.cs" />
<Compile Include="IUsers.cs" />
<Compile Include="IUsersApp.cs" />
<Compile Include="IUsersInfo.cs" />
<Compile Include="IUsersRelation.cs" />
<Compile Include="IUsersRole.cs" />
<Compile Include="IWorkFlow.cs" />
<Compile Include="IWorkFlowArchives.cs" />
<Compile Include="IWorkFlowButtons.cs" />
<Compile Include="IWorkFlowComment.cs" />
<Compile Include="IWorkFlowData.cs" />
<Compile Include="IWorkFlowDelegation.cs" />
<Compile Include="IWorkFlowForm.cs" />
<Compile Include="IWorkFlowTask.cs" />
<Compile Include="IWorkGroup.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RoadFlow.Data.Model\RoadFlow.Data.Model.csproj">
<Project>{75fb2c86-f7d3-4e94-82e9-46dd9787b39d}</Project>
<Name>RoadFlow.Data.Model</Name>
</ProjectReference>
</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>

2
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/.gitignore

@ -0,0 +1,2 @@
bin
obj

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/AppLibrary.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class AppLibrary
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public string ID { get; set; }
/// <summary>
/// 标题
/// </summary>
[DisplayName("标题")]
public string Title { get; set; }
/// <summary>
/// 地址
/// </summary>
[DisplayName("地址")]
public string Address { get; set; }
/// <summary>
/// 分类ID
/// </summary>
[DisplayName("分类ID")]
public Guid Type { get; set; }
/// <summary>
/// 打开方式{0-默认,1-弹出模态窗口,2-弹出窗口,3-新窗口}
/// </summary>
[DisplayName("打开方式{0-默认,1-弹出模态窗口,2-弹出窗口,3-新窗口}")]
public int OpenMode { get; set; }
/// <summary>
/// 弹出窗口宽度
/// </summary>
[DisplayName("弹出窗口宽度")]
public int? Width { get; set; }
/// <summary>
/// 弹出窗口高度
/// </summary>
[DisplayName("弹出窗口高度")]
public int? Height { get; set; }
/// <summary>
/// 其它参数
/// </summary>
[DisplayName("其它参数")]
public string Params { get; set; }
/// <summary>
/// 管理人员
/// </summary>
[DisplayName("管理人员")]
public string Manager { get; set; }
/// <summary>
/// 备注
/// </summary>
[DisplayName("备注")]
public string Note { get; set; }
/// <summary>
/// 唯一标识符,流程应用时为流程ID,表单应用时对应表单ID
/// </summary>
[DisplayName("唯一标识符,流程应用时为流程ID,表单应用时对应表单ID")]
public string Code { get; set; }
/// <summary>
/// 使用人员,为空表示所有人员可以使用
/// </summary>
[DisplayName("使用人员,为空表示所有人员可以使用")]
public string UseMember { get; set; }
}
}

41
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/DBConnection.cs

@ -0,0 +1,41 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class DBConnection
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 连接名称
/// </summary>
[DisplayName("连接名称")]
public string Name { get; set; }
/// <summary>
/// 连接类型
/// </summary>
[DisplayName("连接类型")]
public string Type { get; set; }
/// <summary>
/// 连接字符串
/// </summary>
[DisplayName("连接字符串")]
public string ConnectionString { get; set; }
/// <summary>
/// 备注
/// </summary>
[DisplayName("备注")]
public string Note { get; set; }
}
}

59
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Dictionary.cs

@ -0,0 +1,59 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class Dictionary
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 上级ID
/// </summary>
[DisplayName("上级ID")]
public Guid ParentID { get; set; }
/// <summary>
/// 标题
/// </summary>
[DisplayName("标题")]
public string Title { get; set; }
/// <summary>
/// 唯一代码
/// </summary>
[DisplayName("唯一代码")]
public string Code { get; set; }
/// <summary>
/// 值
/// </summary>
[DisplayName("值")]
public string Value { get; set; }
/// <summary>
/// 备注
/// </summary>
[DisplayName("备注")]
public string Note { get; set; }
/// <summary>
/// 其它信息
/// </summary>
[DisplayName("其它信息")]
public string Other { get; set; }
/// <summary>
/// 排序
/// </summary>
[DisplayName("排序")]
public int Sort { get; set; }
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Log.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class Log
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 标题
/// </summary>
[DisplayName("标题")]
public string Title { get; set; }
/// <summary>
/// 类型
/// </summary>
[DisplayName("类型")]
public string Type { get; set; }
/// <summary>
/// 写入时间
/// </summary>
[DisplayName("写入时间")]
public DateTime WriteTime { get; set; }
/// <summary>
/// 用户ID
/// </summary>
[DisplayName("用户ID")]
public string UserID { get; set; }
/// <summary>
/// 用户姓名
/// </summary>
[DisplayName("用户姓名")]
public string UserName { get; set; }
/// <summary>
/// IP
/// </summary>
[DisplayName("IP")]
public string IPAddress { get; set; }
/// <summary>
/// 发生URL
/// </summary>
[DisplayName("发生URL")]
public string URL { get; set; }
/// <summary>
/// 内容
/// </summary>
[DisplayName("内容")]
public string Contents { get; set; }
/// <summary>
/// Others
/// </summary>
[DisplayName("Others")]
public string Others { get; set; }
/// <summary>
/// 更改前
/// </summary>
[DisplayName("更改前")]
public string OldXml { get; set; }
/// <summary>
/// 更改后
/// </summary>
[DisplayName("更改后")]
public string NewXml { get; set; }
}
}

47
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/OnlineUsers.cs

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Data.Model
{
/// <summary>
/// 在线用户实体
/// </summary>
[Serializable]
public class OnlineUsers
{
/// <summary>
/// 用户ID
/// </summary>
public string ID { get; set; }
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 所在组织
/// </summary>
public string OrgName { get; set; }
/// <summary>
/// 登录IP
/// </summary>
public string IP { get; set; }
/// <summary>
/// 客户端信息 浏览器版本等
/// </summary>
public string ClientInfo { get; set; }
/// <summary>
/// 最后访问页面
/// </summary>
public string LastPage { get; set; }
/// <summary>
/// 登录时间
/// </summary>
public DateTime LoginTime { get; set; }
/// <summary>
/// 唯一ID
/// </summary>
public Guid UniqueID { get; set; }
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Organize.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class Organize
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public string ID { get; set; }
/// <summary>
/// Name
/// </summary>
[DisplayName("Name")]
public string Name { get; set; }
/// <summary>
/// Number
/// </summary>
[DisplayName("Number")]
public string Number2 { get; set; }
/// <summary>
/// 类型:1 单位 2 部门 3 岗位
/// </summary>
[DisplayName("类型:1 单位 2 部门 3 岗位")]
public int Type { get; set; }
/// <summary>
/// 状态 0 正常 1 冻结
/// </summary>
[DisplayName("状态 0 正常 1 冻结")]
public int Status { get; set; }
/// <summary>
/// 父ID
/// </summary>
[DisplayName("父ID")]
public string ParentID { get; set; }
/// <summary>
/// 排序
/// </summary>
[DisplayName("排序")]
public int Sort { get; set; }
/// <summary>
/// 深度
/// </summary>
[DisplayName("深度")]
public int Depth { get; set; }
/// <summary>
/// 下级个数
/// </summary>
[DisplayName("下级个数")]
public int ChildsLength { get; set; }
/// <summary>
/// 分管领导
/// </summary>
[DisplayName("ChargeLeader")]
public string ChargeLeader { get; set; }
/// <summary>
/// 部门或岗位主管
/// </summary>
[DisplayName("Leader")]
public string Leader { get; set; }
/// <summary>
/// Note
/// </summary>
[DisplayName("Note")]
public string Note { get; set; }
}
}

36
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Properties/AssemblyInfo.cs

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

96
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/RoadFlow.Data.Model.csproj

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{75FB2C86-F7D3-4E94-82E9-46DD9787B39D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RoadFlow.Data.Model</RootNamespace>
<AssemblyName>RoadFlow.Data.Model</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</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>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<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="AppLibrary.cs" />
<Compile Include="DBConnection.cs" />
<Compile Include="Dictionary.cs" />
<Compile Include="Log.cs" />
<Compile Include="OnlineUsers.cs" />
<Compile Include="Organize.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Role.cs" />
<Compile Include="RoleApp.cs" />
<Compile Include="Users.cs" />
<Compile Include="UsersApp.cs" />
<Compile Include="UsersInfo.cs" />
<Compile Include="UsersRelation.cs" />
<Compile Include="UsersRole.cs" />
<Compile Include="WorkFlow.cs" />
<Compile Include="WorkFlowArchives.cs" />
<Compile Include="WorkFlowButtons.cs" />
<Compile Include="WorkFlowComment.cs" />
<Compile Include="WorkFlowCustomEventParams.cs" />
<Compile Include="WorkFlowData.cs" />
<Compile Include="WorkFlowDelegation.cs" />
<Compile Include="WorkFlowForm.cs" />
<Compile Include="WorkFlowInstalled.cs" />
<Compile Include="WorkFlowTask.cs" />
<Compile Include="WorkGroup.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ZHYQ\Model\Model.csproj">
<Project>{ac7bcb86-1285-41e2-9266-bf7155d72f25}</Project>
<Name>Model</Name>
</ProjectReference>
</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>

35
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Role.cs

@ -0,0 +1,35 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class Role
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// Name
/// </summary>
[DisplayName("Name")]
public string Name { get; set; }
/// <summary>
/// 使用对象
/// </summary>
[DisplayName("使用对象")]
public string UseMember { get; set; }
/// <summary>
/// Note
/// </summary>
[DisplayName("Note")]
public string Note { get; set; }
}
}

65
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/RoleApp.cs

@ -0,0 +1,65 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class RoleApp
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 上级ID
/// </summary>
[DisplayName("上级ID")]
public Guid ParentID { get; set; }
/// <summary>
/// 角色ID
/// </summary>
[DisplayName("角色ID")]
public Guid RoleID { get; set; }
/// <summary>
/// 应用ID
/// </summary>
[DisplayName("应用ID")]
public Guid? AppID { get; set; }
/// <summary>
/// 显示标题
/// </summary>
[DisplayName("显示标题")]
public string Title { get; set; }
/// <summary>
/// 相关参数
/// </summary>
[DisplayName("相关参数")]
public string Params { get; set; }
/// <summary>
/// 显示顺序
/// </summary>
[DisplayName("显示顺序")]
public int Sort { get; set; }
/// <summary>
/// 应用图标
/// </summary>
[DisplayName("应用图标")]
public string Ico { get; set; }
/// <summary>
/// 0:模板应用 1:个人应用
/// </summary>
[DisplayName("0:模板应用 1:个人应用")]
public int Type { get; set; }
}
}

53
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/Users.cs

@ -0,0 +1,53 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class Users
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public string ID { get; set; }
/// <summary>
/// Name
/// </summary>
[DisplayName("Name")]
public string Name { get; set; }
/// <summary>
/// Account2
/// </summary>
[DisplayName("Account2")]
public string Account2 { get; set; }
/// <summary>
/// Password
/// </summary>
[DisplayName("Password")]
public string Password { get; set; }
/// <summary>
/// 状态 0 正常 1 冻结
/// </summary>
[DisplayName("状态 0 正常 1 冻结")]
public int Status { get; set; }
/// <summary>
/// 排序
/// </summary>
[DisplayName("排序")]
public int Sort { get; set; }
/// <summary>
/// 系统备注
/// </summary>
[DisplayName("系统备注")]
public string Note { get; set; }
}
}

65
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersApp.cs

@ -0,0 +1,65 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class UsersApp
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public string ID { get; set; }
/// <summary>
/// 用户ID
/// </summary>
[DisplayName("用户ID")]
public string UserID { get; set; }
/// <summary>
/// 上级ID
/// </summary>
[DisplayName("上级ID")]
public string ParentID { get; set; }
/// <summary>
/// 角色ID
/// </summary>
[DisplayName("角色ID")]
public string RoleID { get; set; }
/// <summary>
/// 应用ID
/// </summary>
[DisplayName("应用ID")]
public Guid? AppID { get; set; }
/// <summary>
/// 应用标题
/// </summary>
[DisplayName("应用标题")]
public string Title { get; set; }
/// <summary>
/// 参数
/// </summary>
[DisplayName("参数")]
public string Params { get; set; }
/// <summary>
/// 图标
/// </summary>
[DisplayName("图标")]
public string Ico { get; set; }
/// <summary>
/// 序号
/// </summary>
[DisplayName("序号")]
public int Sort { get; set; }
}
}

65
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersInfo.cs

@ -0,0 +1,65 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class UsersInfo
{
/// <summary>
/// UserID
/// </summary>
[DisplayName("UserID")]
public string UserID { get; set; }
/// <summary>
/// 职位
/// </summary>
[DisplayName("职位")]
public string Officer { get; set; }
/// <summary>
/// Tel
/// </summary>
[DisplayName("Tel")]
public string Tel { get; set; }
/// <summary>
/// Fax
/// </summary>
[DisplayName("Fax")]
public string Fax { get; set; }
/// <summary>
/// Address
/// </summary>
[DisplayName("Address")]
public string Address { get; set; }
/// <summary>
/// Email
/// </summary>
[DisplayName("Email")]
public string Email { get; set; }
/// <summary>
/// QQ
/// </summary>
[DisplayName("QQ")]
public string QQ { get; set; }
/// <summary>
/// MSN
/// </summary>
[DisplayName("MSN")]
public string MSN { get; set; }
/// <summary>
/// Note
/// </summary>
[DisplayName("Note")]
public string Note { get; set; }
}
}

35
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersRelation.cs

@ -0,0 +1,35 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class UsersRelation
{
/// <summary>
/// UserID
/// </summary>
[DisplayName("UserID")]
public string UserID { get; set; }
/// <summary>
/// OrganizeID
/// </summary>
[DisplayName("OrganizeID")]
public string OrganizeID { get; set; }
/// <summary>
/// IsMain
/// </summary>
[DisplayName("IsMain")]
public int IsMain { get; set; }
/// <summary>
/// Sort
/// </summary>
[DisplayName("Sort")]
public int Sort { get; set; }
}
}

29
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/UsersRole.cs

@ -0,0 +1,29 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class UsersRole
{
/// <summary>
/// MemberID
/// </summary>
[DisplayName("MemberID")]
public string MemberID { get; set; }
/// <summary>
/// RoleID
/// </summary>
[DisplayName("RoleID")]
public Guid RoleID { get; set; }
/// <summary>
/// 是否为默认角色
/// </summary>
[DisplayName("是否为默认角色")]
public bool IsDefault { get; set; }
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlow.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlow
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 流程名称
/// </summary>
[DisplayName("流程名称")]
public string Name { get; set; }
/// <summary>
/// 流程分类
/// </summary>
[DisplayName("流程分类")]
public Guid Type { get; set; }
/// <summary>
/// 管理人员
/// </summary>
[DisplayName("管理人员")]
public string Manager { get; set; }
/// <summary>
/// 实例管理人员
/// </summary>
[DisplayName("实例管理人员")]
public string InstanceManager { get; set; }
/// <summary>
/// 创建日期
/// </summary>
[DisplayName("创建日期")]
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
[DisplayName("创建人")]
public string CreateUserID { get; set; }
/// <summary>
/// 设计时
/// </summary>
[DisplayName("设计时")]
public string DesignJSON { get; set; }
/// <summary>
/// 安装日期
/// </summary>
[DisplayName("安装日期")]
public DateTime? InstallDate { get; set; }
/// <summary>
/// 安装人员
/// </summary>
[DisplayName("安装人员")]
public Guid? InstallUserID { get; set; }
/// <summary>
/// 运行时
/// </summary>
[DisplayName("运行时")]
public string RunJSON { get; set; }
/// <summary>
/// 状态 1:设计中 2:已安装 3:已卸载 4:已删除
/// </summary>
[DisplayName("状态 1:设计中 2:已安装 3:已卸载 4:已删除")]
public int Status { get; set; }
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowArchives.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowArchives
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 流程ID
/// </summary>
[DisplayName("流程ID")]
public Guid FlowID { get; set; }
/// <summary>
/// 步骤ID
/// </summary>
[DisplayName("步骤ID")]
public Guid StepID { get; set; }
/// <summary>
/// FlowName
/// </summary>
[DisplayName("FlowName")]
public string FlowName { get; set; }
/// <summary>
/// StepName
/// </summary>
[DisplayName("StepName")]
public string StepName { get; set; }
/// <summary>
/// 任务ID
/// </summary>
[DisplayName("任务ID")]
public Guid TaskID { get; set; }
/// <summary>
/// 组
/// </summary>
[DisplayName("组")]
public Guid GroupID { get; set; }
/// <summary>
/// 实例ID
/// </summary>
[DisplayName("实例ID")]
public string InstanceID { get; set; }
/// <summary>
/// 标题
/// </summary>
[DisplayName("标题")]
public string Title { get; set; }
/// <summary>
/// 内容
/// </summary>
[DisplayName("内容")]
public string Contents { get; set; }
/// <summary>
/// 意见内容
/// </summary>
[DisplayName("意见内容")]
public string Comments { get; set; }
/// <summary>
/// 写入时间
/// </summary>
[DisplayName("写入时间")]
public DateTime WriteTime { get; set; }
}
}

47
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowButtons.cs

@ -0,0 +1,47 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowButtons
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 标题
/// </summary>
[DisplayName("标题")]
public string Title { get; set; }
/// <summary>
/// 图标
/// </summary>
[DisplayName("图标")]
public string Ico { get; set; }
/// <summary>
/// 脚本
/// </summary>
[DisplayName("脚本")]
public string Script { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[DisplayName("备注说明")]
public string Note { get; set; }
/// <summary>
/// 排序
/// </summary>
[DisplayName("排序")]
public int Sort { get; set; }
}
}

41
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowComment.cs

@ -0,0 +1,41 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowComment
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// MemberID
/// </summary>
[DisplayName("MemberID")]
public string MemberID { get; set; }
/// <summary>
/// Comment
/// </summary>
[DisplayName("Comment2")]
public string Comment2 { get; set; }
/// <summary>
/// 类型 0管理员添加 1用户添加
/// </summary>
[DisplayName("类型 0管理员添加 1用户添加")]
public int Type { get; set; }
/// <summary>
/// Sort
/// </summary>
[DisplayName("Sort")]
public int Sort { get; set; }
}
}

25
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowCustomEventParams.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Data.Model
{
/// <summary>
/// 调用流程事件时的参数实体
/// </summary>
[Serializable]
public struct WorkFlowCustomEventParams
{
public Guid FlowID { get; set; }
public Guid StepID { get; set; }
public Guid GroupID { get; set; }
public Guid TaskID { get; set; }
public string InstanceID { get; set; }
}
}

47
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowData.cs

@ -0,0 +1,47 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowData
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// InstanceID
/// </summary>
[DisplayName("InstanceID")]
public Guid InstanceID { get; set; }
/// <summary>
/// 连接ID
/// </summary>
[DisplayName("连接ID")]
public Guid LinkID { get; set; }
/// <summary>
/// 表名
/// </summary>
[DisplayName("表名")]
public string TableName { get; set; }
/// <summary>
/// 字段名
/// </summary>
[DisplayName("字段名")]
public string FieldName { get; set; }
/// <summary>
/// 主键值
/// </summary>
[DisplayName("主键值")]
public string Value { get; set; }
}
}

59
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowDelegation.cs

@ -0,0 +1,59 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowDelegation
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 委托人
/// </summary>
[DisplayName("委托人")]
public string UserID { get; set; }
/// <summary>
/// 开始时间
/// </summary>
[DisplayName("开始时间")]
public DateTime StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[DisplayName("结束时间")]
public DateTime EndTime { get; set; }
/// <summary>
/// 委托流程ID,为空表示所有流程
/// </summary>
[DisplayName("委托流程ID,为空表示所有流程")]
public Guid? FlowID { get; set; }
/// <summary>
/// 被委托人
/// </summary>
[DisplayName("被委托人")]
public string ToUserID { get; set; }
/// <summary>
/// 设置时间
/// </summary>
[DisplayName("设置时间")]
public DateTime WriteTime { get; set; }
/// <summary>
/// 备注说明
/// </summary>
[DisplayName("备注说明")]
public string Note { get; set; }
}
}

83
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowForm.cs

@ -0,0 +1,83 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowForm
{
/// <summary>
/// ID
/// </summary>
[DisplayName("ID")]
public Guid ID { get; set; }
/// <summary>
/// 表单名称
/// </summary>
[DisplayName("表单名称")]
public string Name { get; set; }
/// <summary>
/// 表单分类
/// </summary>
[DisplayName("表单分类")]
public Guid Type { get; set; }
/// <summary>
/// 创建人ID
/// </summary>
[DisplayName("创建人ID")]
public string CreateUserID { get; set; }
/// <summary>
/// 创建人姓名
/// </summary>
[DisplayName("创建人姓名")]
public string CreateUserName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[DisplayName("创建时间")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 最后修改时间
/// </summary>
[DisplayName("最后修改时间")]
public DateTime LastModifyTime { get; set; }
/// <summary>
/// 表单html
/// </summary>
[DisplayName("表单html")]
public string Html { get; set; }
/// <summary>
/// 从表设置数据
/// </summary>
[DisplayName("从表设置数据")]
public string SubTableJson { get; set; }
/// <summary>
/// 事件设置
/// </summary>
[DisplayName("事件设置")]
public string EventsJson { get; set; }
/// <summary>
/// 相关属性
/// </summary>
[DisplayName("相关属性")]
public string Attribute { get; set; }
/// <summary>
/// 状态:0 保存 1 编译 2作废
/// </summary>
[DisplayName("状态:0 保存 1 编译 2作废")]
public int Status { get; set; }
}
}

519
Code/ClassLib/RoadFlow/RoadFlow.Data.Model/WorkFlowInstalled.cs

@ -0,0 +1,519 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RoadFlow.Data.Model
{
[Serializable]
public class WorkFlowInstalled
{
/// <summary>
/// 流程ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 流程名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 流程分类
/// </summary>
public string Type { get; set; }
/// <summary>
/// 流程类型:0 常规流程 1 自由流程
/// </summary>
public int FlowType { get; set; }
/// <summary>
/// 流程管理者
/// </summary>
public string Manager { get; set; }
/// <summary>
/// 实例管理者
/// </summary>
public string InstanceManager { get; set; }
/// <summary>
/// 第一步ID
/// </summary>
public Guid FirstStepID { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateUser { get; set; }
/// <summary>
/// 设计时
/// </summary>
public string DesignJSON { get; set; }
/// <summary>
/// 安装日期
/// </summary>
public DateTime InstallTime { get; set; }
/// <summary>
/// 安装人
/// </summary>
public string InstallUser { get; set; }
/// <summary>
/// 运行时JSON
/// </summary>
public string RunJSON { get; set; }
/// <summary>
/// 状态 1:设计中 2:已安装 3:已卸载 4:已删除
/// </summary>
public int Status { get; set; }
/// <summary>
/// 是否删除已完成 0不删除 1要删除
/// </summary>
public int RemoveCompleted { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; }
/// <summary>
/// 是否调试模式 0关闭 1开启(有调试窗口) 2开启(无调试窗口)
/// </summary>
public int Debug { get; set; }
/// <summary>
/// 调试人员
/// </summary>
public List<FangYar.Model.TBL.TBL_SYS_USERS_Model> DebugUsers { get; set; }
/// <summary>
/// 数据库表以及主键信息
/// </summary>
public IEnumerable<WorkFlowInstalledSub.DataBases> DataBases { get; set; }
/// <summary>
/// 数据库表标题字段
/// </summary>
public WorkFlowInstalledSub.TitleField TitleField { get; set; }
/// <summary>
/// 流程步骤
/// </summary>
public IEnumerable<WorkFlowInstalledSub.Step> Steps { get; set; }
/// <summary>
/// 流程连线
/// </summary>
public IEnumerable<WorkFlowInstalledSub.Line> Lines { get; set; }
}
}
namespace RoadFlow.Data.Model.WorkFlowInstalledSub
{
/// <summary>
/// 数据库连接结构体
/// </summary>
[Serializable]
public class DataBases
{
/// <summary>
/// 连接ID
/// </summary>
public Guid LinkID { get; set; }
/// <summary>
/// 连接名称
/// </summary>
public string LinkName { get; set; }
/// <summary>
/// 连接表
/// </summary>
public string Table { get; set; }
/// <summary>
/// 表主键
/// </summary>
public string PrimaryKey { get; set; }
}
/// <summary>
/// 标题字段结构体
/// </summary>
[Serializable]
public class TitleField
{
/// <summary>
/// 连接ID
/// </summary>
public Guid LinkID { get; set; }
/// <summary>
/// 连接名称
/// </summary>
public string LinkName { get; set; }
/// <summary>
/// 连接表
/// </summary>
public string Table { get; set; }
/// <summary>
/// 字段名称
/// </summary>
public string Field { get; set; }
}
/// <summary>
/// 步骤实体类
/// </summary>
[Serializable]
public class Step
{
/// <summary>
/// 步骤ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 步骤类型 normal 一般步骤 subflow 子流程步骤
/// </summary>
public string Type { get; set; }
/// <summary>
/// 步骤名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 意见显示 0不显示 1显示
/// </summary>
public int OpinionDisplay { get; set; }
/// <summary>
/// 超期提示 0不提示 1要提示
/// </summary>
public int ExpiredPrompt { get; set; }
/// <summary>
/// 审签类型 0无签批意见栏 1有签批意见(无须签章) 2有签批意见(须签章)
/// </summary>
public int SignatureType { get; set; }
/// <summary>
/// 工时(小时)
/// </summary>
public decimal WorkTime { get; set; }
/// <summary>
/// 限额时间(小时)
/// </summary>
public decimal LimitTime { get; set; }
/// <summary>
/// 额外时间(小时)
/// </summary>
public decimal OtherTime { get; set; }
/// <summary>
/// 是否归档 0不归档 1要归档
/// </summary>
public int Archives { get; set; }
/// <summary>
/// 归档参数
/// </summary>
public string ArchivesParams { get; set; }
/// <summary>
/// 步骤备注说明
/// </summary>
public string Note { get; set; }
/// <summary>
/// 步骤行为相关参数
/// </summary>
public WorkFlowInstalledSub.StepSet.Behavior Behavior { get; set; }
/// <summary>
/// 流程表单
/// </summary>
public IEnumerable<WorkFlowInstalledSub.StepSet.Form> Forms { get; set; }
/// <summary>
/// 流程按钮
/// </summary>
public IEnumerable<WorkFlowInstalledSub.StepSet.Button> Buttons { get; set; }
/// <summary>
/// 字段状态
/// </summary>
public IEnumerable<WorkFlowInstalledSub.StepSet.FieldStatus> FieldStatus { get; set; }
/// <summary>
/// 流程事件
/// </summary>
public WorkFlowInstalledSub.StepSet.Event Event { get; set; }
/// <summary>
/// 设计时x坐标(用于排序)
/// </summary>
public decimal Position_x { get; set; }
/// <summary>
/// 设计时y坐标(用于排序)
/// </summary>
public decimal Position_y { get; set; }
/// <summary>
/// 子流程ID
/// </summary>
public string SubFlowID { get; set; }
}
/// <summary>
/// 流程连线实体
/// </summary>
public class Line
{
/// <summary>
/// 连线ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 连线源步骤ID
/// </summary>
public Guid FromID { get; set; }
/// <summary>
/// 连线目标ID
/// </summary>
public Guid ToID { get; set; }
/// <summary>
/// 连线流转条件判断方法
/// </summary>
public string CustomMethod { get; set; }
/// <summary>
/// 连线提交条件sql条件
/// </summary>
public string SqlWhere { get; set; }
/// <summary>
/// 条件不满足时的提示信息
/// </summary>
public string NoAccordMsg { get; set; }
/// <summary>
/// 发送者属于
/// </summary>
public string Organize_SenderIn { get; set; }
/// <summary>
/// 发送者不属于
/// </summary>
public string Organize_SenderNotIn { get; set; }
/// <summary>
/// 发起者属于
/// </summary>
public string Organize_SponsorIn { get; set; }
/// <summary>
/// 发起者不属于
/// </summary>
public string Organize_SponsorNotIn { get; set; }
/// <summary>
/// 发送者是部门领导
/// </summary>
public string Organize_SenderLeader { get; set; }
/// <summary>
/// 发送者是部门分管领导
/// </summary>
public string Organize_SenderChargeLeader { get; set; }
/// <summary>
/// 发起者是部门领导
/// </summary>
public string Organize_SponsorLeader { get; set; }
/// <summary>
/// 发起者是部门分管领导
/// </summary>
public string Organize_SponsorChargeLeader { get; set; }
/// <summary>
/// 发送者不是部门领导
/// </summary>
public string Organize_NotSenderLeader { get; set; }
/// <summary>
/// 发送者不是部门分管领导
/// </summary>
public string Organize_NotSenderChargeLeader { get; set; }
/// <summary>
/// 发起者不是部门领导
/// </summary>
public string Organize_NotSponsorLeader { get; set; }
/// <summary>
/// 发起者不是部门分管领导
/// </summary>
public string Organize_NotSponsorChargeLeader { get; set; }
}
}
namespace RoadFlow.Data.Model.WorkFlowInstalledSub.StepSet
{
/// <summary>
/// 步骤行为实体
/// </summary>
[Serializable]
public class Behavior
{
/// <summary>
/// 流转类型 0系统控制 1单选一个分支流转 2多选几个分支流转
/// </summary>
public int FlowType { get; set; }
/// <summary>
/// 运行时选择 0不允许 1允许
/// </summary>
public int RunSelect { get; set; }
/// <summary>
/// 处理者类型 0所有成员 1部门 2岗位 3工作组 4人员 5发起者 6前一步骤处理者 7某一步骤处理者 8字段值 9发起者主管 10发起者分管领导 11当前处理者主管 12当前处理者分管领导
/// </summary>
public int HandlerType { get; set; }
/// <summary>
/// 选择范围
/// </summary>
public string SelectRange { get; set; }
/// <summary>
/// 当处理者类型为 7某一步骤处理者 时的处理者步骤
/// </summary>
public Guid HandlerStepID { get; set; }
/// <summary>
/// 当处理者类型为 8字段值 时的字段
/// </summary>
public string ValueField { get; set; }
/// <summary>
/// 默认处理者
/// </summary>
public string DefaultHandler { get; set; }
/// <summary>
/// 退回策略 0不能退回 1单个退回 2全部退回
/// </summary>
public int BackModel { get; set; }
/// <summary>
/// 处理策略 0所有人必须处理 1一人同意即可 2依据人数比例 3独立处理
/// </summary>
public int HanlderModel { get; set; }
/// <summary>
/// 退回类型 0退回前一步 1退回第一步 2退回某一步
/// </summary>
public int BackType { get; set; }
/// <summary>
/// 策略百分比
/// </summary>
public decimal Percentage { get; set; }
/// <summary>
/// 退回步骤ID 当退回类型为 2退回某一步 时
/// </summary>
public Guid BackStepID { get; set; }
/// <summary>
/// 会签策略 0 不会签 1 所有步骤同意 2 一个步骤同意即可 3 依据比例
/// </summary>
public int Countersignature { get; set; }
/// <summary>
/// 会签策略是依据比例时设置的百分比
/// </summary>
public decimal CountersignaturePercentage { get; set; }
/// <summary>
/// 子流程处理策略 0 子流程完成后才能提交 1 子流程发起即可提交
/// </summary>
public int SubFlowStrategy { get; set; }
/// <summary>
/// 抄送人员
/// </summary>
public string CopyFor { get; set; }
}
/// <summary>
/// 表单实体
/// </summary>
[Serializable]
public class Form
{
/// <summary>
/// 表单ID
/// </summary>
public Guid ID { get; set; }
/// <summary>
/// 表单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
/// <summary>
/// 流程按钮
/// </summary>
[Serializable]
public class Button
{
/// <summary>
/// 按钮ID(为guid则是按钮库中的按钮,否则为其它特定功能按钮)
/// </summary>
public string ID { get; set; }
/// <summary>
/// 按钮说明
/// </summary>
public string Note { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
/// <summary>
/// 字段状态
/// </summary>
[Serializable]
public class FieldStatus
{
/// <summary>
/// 字段
/// </summary>
public string Field { get; set; }
/// <summary>
/// 状态 0编辑 1只读 2隐藏
/// </summary>
public int Status1 { get; set; }
/// <summary>
/// 数据检查 0不检查 1允许为空,非空时检查 2不允许为空,并检查
/// </summary>
public int Check { get; set; }
}
/// <summary>
/// 相关事件
/// </summary>
[Serializable]
public class Event
{
/// <summary>
/// 步骤提交前事件
/// </summary>
public string SubmitBefore { get; set; }
/// <summary>
/// 步骤提交后事件
/// </summary>
public string SubmitAfter { get; set; }
/// <summary>
/// 步骤退回前事件
/// </summary>
public string BackBefore { get; set; }
/// <summary>
/// 步骤退回后事件
/// </summary>
public string BackAfter { get; set; }
/// <summary>
/// 子流程激活前事件
/// </summary>
public string SubFlowActivationBefore { get; set; }
/// <summary>
/// 子流程完成后事件
/// </summary>
public string SubFlowCompletedBefore { get; set; }
}
}

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

Loading…
Cancel
Save