├── .gitattributes
├── .gitignore
├── Common
├── BaseSocket.cs
├── Common.csproj
├── Deflate.cs
├── Misc.cs
├── Model
│ ├── BuildInfo.cs
│ ├── ClientInfo.cs
│ ├── ColumnInfo.cs
│ ├── DataSort.cs
│ ├── DatabaseInfo.cs
│ ├── ForeignKeyInfo.cs
│ └── TableInfo.cs
├── NpgsqlDbType.cs
└── Properties
│ └── AssemblyInfo.cs
├── GenPg
├── ConsoleApp.cs
├── Deflate.cs
├── FastExcel
│ ├── Cell.cs
│ ├── FastExcel.Add.cs
│ ├── FastExcel.Delete.cs
│ ├── FastExcel.Read.cs
│ ├── FastExcel.Update.cs
│ ├── FastExcel.Worksheets.cs
│ ├── FastExcel.Write.cs
│ ├── FastExcel.cs
│ ├── Row.cs
│ ├── SharedStrings.cs
│ ├── Worksheet.cs
│ └── WorksheetAddSettings.cs
├── GenPg.csproj
├── Lib
│ ├── IniHelper.cs
│ ├── JSDecoder.cs
│ └── Lib.cs
├── Model
│ ├── BuildInfo.cs
│ ├── ClientInfo.cs
│ ├── ColumnInfo.cs
│ ├── DataSort.cs
│ ├── DatabaseInfo.cs
│ ├── ForeignKeyInfo.cs
│ └── TableInfo.cs
├── NPinyin
│ ├── Pinyin.cs
│ ├── PyCode.cs
│ └── PyHash.cs
├── NpgsqlDbType.cs
├── Program.cs
├── Properties
│ └── launchSettings.json
├── WinFormClass
│ ├── Robot.cs
│ ├── Socket
│ │ ├── BaseSocket.cs
│ │ ├── ClientSocket.cs
│ │ └── ServerSocket.cs
│ └── WorkQueue.cs
└── plist-cil
│ ├── ASCIIPropertyListParser.cs
│ ├── BinaryPropertyListParser.cs
│ ├── BinaryPropertyListWriter.cs
│ ├── NSArray.IList.cs
│ ├── NSArray.cs
│ ├── NSData.cs
│ ├── NSDate.cs
│ ├── NSDictionary.cs
│ ├── NSNumber.cs
│ ├── NSObject.cs
│ ├── NSSet.cs
│ ├── NSString.cs
│ ├── PropertyListException.cs
│ ├── PropertyListFormatException.cs
│ ├── PropertyListParser.cs
│ ├── UID.cs
│ └── XmlPropertyListParser.cs
├── LICENSE
├── MakeCode
├── ClientSocket.cs
├── ConsoleApp.cs
├── FrmMain.cs
├── FrmMain.designer.cs
├── FrmMain.resx
├── FrmView.cs
├── FrmView.designer.cs
├── FrmView.resx
├── Lib.cs
├── MakeCode.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Settings.Designer.cs
├── Settings.settings
└── app.config
├── Mono.Security.dll
├── Npgsql.dll
├── README.md
├── Server
├── CodeBuild(Code).cs
├── CodeBuild(Const).cs
├── CodeBuild(DB).cs
├── CodeBuild(Lib).cs
├── Logger.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Protocol.cs
├── Resources
│ ├── .gitattributes
│ ├── .gitignore
│ ├── Infrastructure
│ │ ├── Controllers
│ │ │ ├── BaseController.cs
│ │ │ └── CustomExceptionFilter.cs
│ │ ├── Extensions
│ │ │ └── GlobalExtensions.cs
│ │ └── ModuleBasic
│ │ │ ├── IModuleInitializer.cs
│ │ │ ├── ModuleInfo.cs
│ │ │ └── ModuleViewLocationExpander.cs
│ ├── WebHost
│ │ ├── .gitignore
│ │ ├── gulpfile.js
│ │ ├── package.json
│ │ └── web.config
│ ├── build.bat
│ └── htm.zip
├── Server.csproj
├── ServerSocket.cs
├── log4net.config
└── packages.config
├── ServerWinForm
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ServerWinForm.csproj
├── Settings.Designer.cs
├── Settings.settings
└── app.config
├── ServerWinService
├── Install1.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── ServerWinService.csproj
├── Service1.Designer.cs
├── Service1.cs
├── Settings.Designer.cs
├── Settings.settings
└── app.config
├── core+postgresql.sln
├── docs
├── _sidebar.md
├── index.html
└── readme.md
└── log4net.dll
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | [Xx]64/
19 | [Xx]86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 |
24 | # Visual Studio 2015 cache/options directory
25 | .vs/
26 | # Uncomment if you have tasks that create the project's static files in wwwroot
27 | #wwwroot/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | # NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | # DNX
43 | project.lock.json
44 | package-lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 | *.sap
90 |
91 | # TFS 2012 Local Workspace
92 | $tf/
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 | *.DotSettings.user
101 |
102 | # JustCode is a .NET coding add-in
103 | .JustCode
104 |
105 | # TeamCity is a build add-in
106 | _TeamCity*
107 |
108 | # DotCover is a Code Coverage Tool
109 | *.dotCover
110 |
111 | # NCrunch
112 | _NCrunch_*
113 | .*crunch*.local.xml
114 | nCrunchTemp_*
115 |
116 | # MightyMoose
117 | *.mm.*
118 | AutoTest.Net/
119 |
120 | # Web workbench (sass)
121 | .sass-cache/
122 |
123 | # Installshield output folder
124 | [Ee]xpress/
125 |
126 | # DocProject is a documentation generator add-in
127 | DocProject/buildhelp/
128 | DocProject/Help/*.HxT
129 | DocProject/Help/*.HxC
130 | DocProject/Help/*.hhc
131 | DocProject/Help/*.hhk
132 | DocProject/Help/*.hhp
133 | DocProject/Help/Html2
134 | DocProject/Help/html
135 |
136 | # Click-Once directory
137 | publish/
138 |
139 | # Publish Web Output
140 | *.[Pp]ublish.xml
141 | *.azurePubxml
142 |
143 | # TODO: Un-comment the next line if you do not want to checkin
144 | # your web deploy settings because they may include unencrypted
145 | # passwords
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # NuGet Packages
150 | *.nupkg
151 | # The packages folder can be ignored because of Package Restore
152 | **/packages/*
153 | # except build/, which is used as an MSBuild target.
154 | !**/packages/build/
155 | # Uncomment if necessary however generally it will be regenerated when needed
156 | #!**/packages/repositories.config
157 | # NuGet v3's project.json files produces more ignoreable files
158 | *.nuget.props
159 | *.nuget.targets
160 |
161 | # Microsoft Azure Build Output
162 | csx/
163 | *.build.csdef
164 |
165 | # Microsoft Azure Emulator
166 | ecf/
167 | rcf/
168 |
169 | # Microsoft Azure ApplicationInsights config file
170 | ApplicationInsights.config
171 |
172 | # Windows Store app package directory
173 | AppPackages/
174 | BundleArtifacts/
175 |
176 | # Visual Studio cache files
177 | # files ending in .cache can be ignored
178 | *.[Cc]ache
179 | # but keep track of directories ending in .cache
180 | !*.[Cc]ache/
181 |
182 | # Others
183 | ClientBin/
184 | [Ss]tyle[Cc]op.*
185 | ~$*
186 | *~
187 | *.dbmdl
188 | *.dbproj.schemaview
189 | *.pfx
190 | *.publishsettings
191 | node_modules/
192 | orleans.codegen.cs
193 |
194 | # RIA/Silverlight projects
195 | Generated_Code/
196 |
197 | # Backup & report files from converting an old project file
198 | # to a newer Visual Studio version. Backup files are not needed,
199 | # because we have git ;-)
200 | _UpgradeReport_Files/
201 | Backup*/
202 | UpgradeLog*.XML
203 | UpgradeLog*.htm
204 |
205 | # SQL Server files
206 | *.mdf
207 | *.ldf
208 |
209 | # Business Intelligence projects
210 | *.rdl.data
211 | *.bim.layout
212 | *.bim_*.settings
213 |
214 | # Microsoft Fakes
215 | FakesAssemblies/
216 |
217 | # GhostDoc plugin setting file
218 | *.GhostDoc.xml
219 |
220 | # Node.js Tools for Visual Studio
221 | .ntvs_analysis.dat
222 |
223 | # Visual Studio 6 build log
224 | *.plg
225 |
226 | # Visual Studio 6 workspace options file
227 | *.opt
228 |
229 | # Visual Studio LightSwitch build output
230 | **/*.HTMLClient/GeneratedArtifacts
231 | **/*.DesktopClient/GeneratedArtifacts
232 | **/*.DesktopClient/ModelManifest.xml
233 | **/*.Server/GeneratedArtifacts
234 | **/*.Server/ModelManifest.xml
235 | _Pvt_Extensions
236 |
237 | # LightSwitch generated files
238 | GeneratedArtifacts/
239 | ModelManifest.xml
240 |
241 | # Paket dependency manager
242 | .paket/paket.exe
243 |
244 | # FAKE - F# Make
245 | .fake/
--------------------------------------------------------------------------------
/Common/Common.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}
9 | Library
10 | Properties
11 | Common
12 | Common
13 | v2.0
14 |
15 |
16 |
17 |
18 | 2.0
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
64 |
--------------------------------------------------------------------------------
/Common/Deflate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.IO.Compression;
4 | using System.Text;
5 |
6 | public static class Deflate {
7 |
8 | public static string cs_head = string.Empty;
9 |
10 | public static byte[] Decompress(Stream stream) {
11 | try {
12 | stream.Position = 0;
13 | using (MemoryStream ms = new MemoryStream()) {
14 | using (DeflateStream def = new DeflateStream(stream, CompressionMode.Decompress)) {
15 | byte[] data = new byte[1024];
16 | int size = 0;
17 |
18 | while ((size = def.Read(data, 0, data.Length)) > 0) {
19 | ms.Write(data, 0, size);
20 | }
21 | }
22 | return ms.ToArray();
23 | }
24 | } catch { return (stream as MemoryStream).ToArray(); };
25 | }
26 | public static byte[] Decompress(byte[] bt) {
27 | return Decompress(new MemoryStream(bt));
28 | }
29 |
30 | public static byte[] Compress(string text) {
31 | if (text.Trim().StartsWith("using ")) {
32 | text = Deflate.cs_head + text;
33 | }
34 | return Compress(Encoding.UTF8.GetBytes(text));
35 | }
36 | public static byte[] Compress(byte[] bt) {
37 | return Compress(bt, 0, bt.Length);
38 | }
39 | public static byte[] Compress(byte[] bt, int startIndex, int length) {
40 | using (MemoryStream ms = new MemoryStream()) {
41 | using (DeflateStream def = new DeflateStream(ms, CompressionMode.Compress)) {
42 | def.Write(bt, startIndex, length);
43 | }
44 | return ms.ToArray();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Common/Misc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | public delegate void AnonymousHandler();
--------------------------------------------------------------------------------
/Common/Model/BuildInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Model {
4 |
5 | [Serializable]
6 | public class BuildInfo {
7 |
8 | private string _path;
9 | private byte[] _data;
10 |
11 | public BuildInfo() { }
12 | public BuildInfo(string path, byte[] data) {
13 | _path = path;
14 | _data = data;
15 | }
16 |
17 | public string Path {
18 | get { return _path; }
19 | }
20 |
21 | public byte[] Data {
22 | get { return _data; }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Common/Model/ClientInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ClientInfo {
9 | private string _server;
10 | private int _port;
11 | private string _username;
12 | private string _password;
13 | private string _database;
14 |
15 | public ClientInfo(string server, int port, string username, string password) {
16 | _server = server;
17 | _port = port;
18 | _username = username;
19 | _password = password;
20 | }
21 |
22 | public string Server {
23 | get { return _server; }
24 | }
25 | public int Port {
26 | get { return _port; }
27 | }
28 | public string Username {
29 | get { return _username; }
30 | }
31 | public string Password {
32 | get { return _password; }
33 | }
34 | public string Database {
35 | get { return _database; }
36 | set { _database = value; }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Common/Model/ColumnInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ColumnInfo {
9 |
10 | private string _name;
11 | private NpgsqlDbType _type;
12 | private long _length;
13 | private string _sqlType;
14 | private string _csType;
15 | private DataSort _orderby;
16 | private bool _isNullable;
17 | private bool _isIdentity;
18 | private bool _isClustered;
19 | private bool _isPrimaryKey;
20 | private int _attndims;
21 | private int _attnum;
22 |
23 | public ColumnInfo() { }
24 | public ColumnInfo(string name, NpgsqlDbType type, long length, string sqlType, string csType, DataSort orderby, bool isNullable, bool isIdentity, bool isClustered, bool isPrimaryKey, int attndims, int attnum) {
25 | _name = name;
26 | _type = type;
27 | _length = length;
28 | _sqlType = sqlType;
29 | _csType = csType;
30 | _orderby = orderby;
31 | _isNullable = isNullable;
32 | _isIdentity = isIdentity;
33 | _isClustered = isClustered;
34 | _isPrimaryKey = isPrimaryKey;
35 | _attndims = attndims;
36 | _attnum = attnum;
37 | }
38 |
39 | public string Name {
40 | get { return _name; }
41 | set { _name = value; }
42 | }
43 | public NpgsqlDbType Type {
44 | get { return _type; }
45 | set { _type = value; }
46 | }
47 | public long Length {
48 | get { return _length; }
49 | set { _length = value; }
50 | }
51 | public string SqlType {
52 | get { return _sqlType; }
53 | set { _sqlType = value; }
54 | }
55 | public string CsType {
56 | get { return _csType; }
57 | set { _csType = value; }
58 | }
59 | public DataSort Orderby {
60 | get { return _orderby; }
61 | set { _orderby = value; }
62 | }
63 | public bool IsNullable {
64 | get { return _isNullable; }
65 | set { _isNullable = value; }
66 | }
67 | public bool IsIdentity {
68 | get { return _isIdentity; }
69 | set { _isIdentity = value; }
70 | }
71 | public bool IsClustered {
72 | get { return _isClustered; }
73 | set { _isClustered = value; }
74 | }
75 | public bool IsPrimaryKey {
76 | get { return _isPrimaryKey; }
77 | set { _isPrimaryKey = value; }
78 | }
79 | public int Attndims {
80 | get { return _attndims; }
81 | set { _attndims = value; }
82 | }
83 | public int Attnum {
84 | get { return _attnum; }
85 | set { _attnum = value; }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/Common/Model/DataSort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Model {
4 |
5 | [Serializable]
6 | public enum DataSort {
7 | NONE = 0,
8 | ASC = 1,
9 | DESC = 2
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Common/Model/DatabaseInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class DatabaseInfo {
9 |
10 | private string _name;
11 |
12 | public DatabaseInfo() { }
13 | public DatabaseInfo(string name) {
14 | _name = name;
15 | }
16 |
17 | public string Name {
18 | get { return _name; }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Common/Model/ForeignKeyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Collections.Generic;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ForeignKeyInfo {
9 | private TableInfo _table;
10 | private List _columns = new List();
11 |
12 | private TableInfo _referencedTable;
13 | private List _referencedColumns = new List();
14 |
15 | private string _referencedDBName;
16 | private string _referencedTableName;
17 | private List _referencedColumnNames = new List();
18 | private bool _referencedIsPrimaryKey;
19 |
20 | public ForeignKeyInfo(TableInfo table, TableInfo referencedTable) {
21 | _table = table;
22 | _referencedTable = referencedTable;
23 | }
24 | public ForeignKeyInfo(string referencedSln, string referencedTableName, bool referencedIsPK) {
25 | _referencedDBName = referencedSln;
26 | _referencedTableName = referencedTableName;
27 | _referencedIsPrimaryKey = referencedIsPK;
28 | }
29 |
30 | public TableInfo Table {
31 | get { return _table; }
32 | set { _table = value; }
33 | }
34 | public List Columns {
35 | get { return _columns; }
36 | set { _columns = value; }
37 | }
38 |
39 | public TableInfo ReferencedTable {
40 | get { return _referencedTable; }
41 | set { _referencedTable = value; }
42 | }
43 | public List ReferencedColumns {
44 | get { return _referencedColumns; }
45 | set { _referencedColumns = value; }
46 | }
47 |
48 | public string ReferencedDBName {
49 | get { return _referencedDBName; }
50 | set { _referencedDBName = value; }
51 | }
52 | public string ReferencedTableName {
53 | get { return _referencedTableName; }
54 | set { _referencedTableName = value; }
55 | }
56 | public List ReferencedColumnNames {
57 | get { return _referencedColumnNames; }
58 | set { _referencedColumnNames = value; }
59 | }
60 | public bool ReferencedIsPrimaryKey {
61 | get { return _referencedIsPrimaryKey; }
62 | set { _referencedIsPrimaryKey = value; }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Common/Model/TableInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Text.RegularExpressions;
4 | using System.Collections.Generic;
5 |
6 | namespace Model {
7 |
8 | [Serializable]
9 | public class TableInfo {
10 |
11 | private string _id;
12 | private string _owner;
13 | private string _name;
14 | private List _columns = new List();
15 | private List> _uniques = new List>();
16 | private List> _indexes = new List>();
17 | private List _foreignKeys = new List();
18 | private List _identitys = new List();
19 | private List _clustereds = new List();
20 | private List _primaryKeys = new List();
21 | private string _Type;
22 | private bool _IsOutput;
23 |
24 | public TableInfo(string id, string owner, string name, string type) {
25 | _id = id;
26 | _owner = owner;
27 | _name = name;
28 | _Type = type;
29 | }
30 |
31 | public static string GetClassName(string name) {
32 | int rr = 0;
33 | string n = name.StartsWith("public.") ? name.Substring(7) : Regex.Replace(name, @"\.", delegate(Match m) {
34 | if (rr++ > 0) return m.Groups[0].Value;
35 | return "_";
36 | });
37 | return char.IsLetter(n, 0) ? n : string.Concat("_", n);
38 | }
39 | public static string GetEntryName(string name) {
40 | int idx = name.IndexOf('.');
41 | return idx == -1 ? name : name.Substring(idx + 1);
42 | }
43 |
44 | public string Id {
45 | get { return _id; }
46 | }
47 | public string Owner {
48 | get { return _owner; }
49 | }
50 | public string Name {
51 | get { return _name; }
52 | }
53 | public string ClassName {
54 | get {
55 | return GetClassName(_owner.ToLower() + "." + _name);
56 | }
57 | }
58 | public string FullName {
59 | get { return string.IsNullOrEmpty(_owner) ? _name : string.Format("{0}.{1}", _owner, _name); }
60 | }
61 | public string Type {
62 | get { return _Type; }
63 | }
64 |
65 | public List Columns {
66 | get { return _columns; }
67 | }
68 | public List> Uniques {
69 | get {
70 | if (_uniques == null) {
71 |
72 | }
73 | return _uniques;
74 | }
75 | }
76 | public List> Indexes {
77 | get {
78 | if (_indexes == null) {
79 |
80 | }
81 | return _indexes;
82 | }
83 | }
84 | public List ForeignKeys {
85 | get {
86 | if (_foreignKeys == null) {
87 |
88 | }
89 | return _foreignKeys;
90 | }
91 | }
92 | public List PrimaryKeys {
93 | get {
94 | if (_primaryKeys == null) {
95 |
96 | }
97 | return _primaryKeys;
98 | }
99 | }
100 | public List Clustereds {
101 | get {
102 | if (_clustereds == null) {
103 |
104 | }
105 | return _clustereds;
106 | }
107 | }
108 | public List Identitys {
109 | get {
110 | if (_identitys == null) {
111 |
112 | }
113 | return _identitys;
114 | }
115 | }
116 |
117 | public bool IsOutput {
118 | get { return _IsOutput; }
119 | set { _IsOutput = value; }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Common/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Common")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Common")]
13 | [assembly: AssemblyCopyright("版权所有 (C) 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("b3e3991f-30e6-4edf-ad0b-8a24b747de76")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/GenPg/Deflate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.IO.Compression;
4 | using System.Text;
5 |
6 | public static class Deflate {
7 |
8 | public static string cs_head = string.Empty;
9 |
10 | public static byte[] Decompress(Stream stream) {
11 | try {
12 | stream.Position = 0;
13 | using (MemoryStream ms = new MemoryStream()) {
14 | using (DeflateStream def = new DeflateStream(stream, CompressionMode.Decompress)) {
15 | byte[] data = new byte[1024];
16 | int size = 0;
17 |
18 | while ((size = def.Read(data, 0, data.Length)) > 0) {
19 | ms.Write(data, 0, size);
20 | }
21 | }
22 | return ms.ToArray();
23 | }
24 | } catch { return (stream as MemoryStream).ToArray(); };
25 | }
26 | public static byte[] Decompress(byte[] bt) {
27 | return Decompress(new MemoryStream(bt));
28 | }
29 |
30 | public static byte[] Compress(string text) {
31 | if (text.Trim().StartsWith("using ")) {
32 | text = Deflate.cs_head + text;
33 | }
34 | return Compress(Encoding.UTF8.GetBytes(text));
35 | }
36 | public static byte[] Compress(byte[] bt) {
37 | return Compress(bt, 0, bt.Length);
38 | }
39 | public static byte[] Compress(byte[] bt, int startIndex, int length) {
40 | using (MemoryStream ms = new MemoryStream()) {
41 | using (DeflateStream def = new DeflateStream(ms, CompressionMode.Compress)) {
42 | def.Write(bt, startIndex, length);
43 | }
44 | return ms.ToArray();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/Cell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Text.RegularExpressions;
6 | using System.Threading.Tasks;
7 | using System.Xml.Linq;
8 |
9 | namespace FastExcel {
10 | ///
11 | /// Contains the actual value
12 | ///
13 | public class Cell {
14 | ///
15 | /// Column Numnber (Starts at 1)
16 | ///
17 | public int ColumnNumber { get; set; }
18 |
19 | ///
20 | /// The value that is stored
21 | ///
22 | public object Value { get; set; }
23 |
24 | ///
25 | /// Create a new Cell
26 | ///
27 | /// Column number starting at 1
28 | /// Cell Value
29 | public Cell(int columnNumber, object value) {
30 | if (columnNumber <= 0) {
31 | throw new Exception("Column numbers starting at 1");
32 | }
33 | this.ColumnNumber = columnNumber;
34 | this.Value = value;
35 | }
36 |
37 | ///
38 | /// Create a new Cell
39 | ///
40 | /// Cell
41 | /// The collection of shared strings used by this document
42 | public Cell(XElement cellElement, SharedStrings sharedStrings) {
43 | bool isTextRow = (from a in cellElement.Attributes("t")
44 | where a.Value == "s"
45 | select a).Any();
46 | string columnName = (from a in cellElement.Attributes("r")
47 | select a.Value).FirstOrDefault();
48 |
49 | this.ColumnNumber = GetExcelColumnNumber(columnName);
50 |
51 | if (isTextRow) {
52 | this.Value = sharedStrings.GetString(cellElement.Value);
53 | } else {
54 | this.Value = cellElement.Value;
55 | }
56 | }
57 |
58 | internal StringBuilder ToXmlString(SharedStrings sharedStrings, int rowNumber) {
59 | StringBuilder cell = new StringBuilder();
60 |
61 | if (this.Value != null) {
62 | bool isString = false;
63 | object value = this.Value;
64 |
65 | if (this.Value is int) {
66 | isString = false;
67 | } else if (this.Value is double) {
68 | isString = false;
69 | } else if (this.Value is string) {
70 | isString = true;
71 | }
72 |
73 | if (isString) {
74 | value = sharedStrings.AddString(value.ToString());
75 | }
76 |
77 | cell.AppendFormat("", GetExcelColumnName(this.ColumnNumber), rowNumber, (isString ? " t=\"s\"" : string.Empty));
78 | cell.AppendFormat("{0}", value);
79 | cell.Append("");
80 | }
81 |
82 | return cell;
83 | }
84 |
85 | //http://stackoverflow.com/questions/181596/how-to-convert-a-column-number-eg-127-into-an-excel-column-eg-aa
86 | ///
87 | /// Convert Column Number into Column Name - Character(s) eg 1-A, 2-B
88 | ///
89 | /// Column Number
90 | /// Column Name - Character(s)
91 | public static string GetExcelColumnName(int columnNumber) {
92 | int dividend = columnNumber;
93 | string columnName = String.Empty;
94 | int modulo;
95 |
96 | while (dividend > 0) {
97 | modulo = (dividend - 1) % 26;
98 | columnName = string.Concat(Convert.ToChar(65 + modulo), columnName);
99 | dividend = (int)((dividend - modulo) / 26);
100 | }
101 |
102 | return columnName;
103 | }
104 |
105 | //http://stackoverflow.com/questions/181596/how-to-convert-a-column-number-eg-127-into-an-excel-column-eg-aa
106 | ///
107 | /// Covert Column Name - Character(s) into a Column Number eg A-1, B-2, A1 - 1, B9 - 2
108 | ///
109 | /// Column Name - Character(s) optinally with the Row Number
110 | /// Specify if the row number is included
111 | /// Column Number
112 | public static int GetExcelColumnNumber(string columnName, bool includesRowNumber = true) {
113 | if (includesRowNumber) {
114 | columnName = Regex.Replace(columnName, @"\d", "");
115 | }
116 |
117 | int[] digits = new int[columnName.Length];
118 | for (int i = 0; i < columnName.Length; ++i) {
119 | digits[i] = Convert.ToInt32(columnName[i]) - 64;
120 | }
121 | int mul = 1; int res = 0;
122 | for (int pos = digits.Length - 1; pos >= 0; --pos) {
123 | res += digits[pos] * mul;
124 | mul *= 26;
125 | }
126 | return res;
127 | }
128 |
129 | ///
130 | /// Merge the parameter cell into this cell
131 | ///
132 | /// Cell to merge
133 | public void Merge(Cell cell) {
134 | this.Value = cell.Value;
135 | }
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Add.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Linq;
9 |
10 | namespace FastExcel {
11 | public partial class FastExcel {
12 | ///
13 | /// Append new worksheet
14 | ///
15 | /// New worksheet
16 | public void Add(Worksheet worksheet) {
17 | this.Add(worksheet, null, null);
18 | }
19 |
20 | public void Add(Worksheet worksheet, int insertAfterSheetNumber) {
21 | this.Add(worksheet, insertAfterSheetNumber, null);
22 | }
23 |
24 | public void Add(Worksheet worksheet, string insertAfterSheetName) {
25 | this.Add(worksheet, null, insertAfterSheetName);
26 | }
27 |
28 | private void Add(Worksheet worksheet, int? insertAfterSheetNumber = null, string insertAfterSheetName = null) {
29 | CheckFiles();
30 |
31 | PrepareArchive(true);
32 |
33 | worksheet.ValidateNewWorksheet(this, insertAfterSheetNumber, insertAfterSheetName);
34 |
35 | if (this.AddWorksheets == null) {
36 | this.AddWorksheets = new List();
37 | }
38 |
39 | this.AddWorksheets.Add(worksheet.AddSettings);
40 |
41 |
42 | if (!this.ReadOnly) {
43 | throw new Exception("FastExcel is in ReadOnly mode so cannot perform a write");
44 | }
45 |
46 | // Check if ExistingHeadingRows will be overridden by the dataset
47 | if (worksheet.ExistingHeadingRows != 0 && worksheet.Rows.Where(r => r.RowNumber <= worksheet.ExistingHeadingRows).Any()) {
48 | throw new Exception("Existing Heading Rows was specified but some or all will be overridden by data rows. Check DataSet.Row.RowNumber against ExistingHeadingRows");
49 | }
50 |
51 | using (StreamWriter streamWriter = null)//new StreamWriter(this.Archive.CreateEntry(worksheet.FileName).Open()))
52 | {
53 | streamWriter.Write(worksheet.Headers);
54 | if (!worksheet.Template) {
55 | worksheet.Headers = null;
56 | }
57 |
58 | this.SharedStrings.ReadWriteMode = true;
59 |
60 | // Add Rows
61 | foreach (Row row in worksheet.Rows) {
62 | streamWriter.Write(row.ToXmlString(this.SharedStrings));
63 | }
64 | this.SharedStrings.ReadWriteMode = false;
65 |
66 | //Add Footers
67 | streamWriter.Write(worksheet.Footers);
68 | if (!worksheet.Template) {
69 | worksheet.Footers = null;
70 | }
71 | streamWriter.Flush();
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Delete.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Linq;
9 |
10 | namespace FastExcel {
11 | public partial class FastExcel {
12 | ///
13 | /// Deletes the selected sheet Note:delete happens on Dispose
14 | ///
15 | /// sheet number, starts at 1
16 | public void Delete(int sheetNumber) {
17 | this.Delete(sheetNumber, null);
18 | }
19 |
20 | ///
21 | /// Deletes the selected sheet Note:delete happens on Dispose
22 | ///
23 | /// Worksheet name
24 | public void Delete(string sheetName) {
25 | this.Update(null, sheetName);
26 | }
27 |
28 | private void Delete(int? sheetNumber = null, string sheetName = null) {
29 | CheckFiles();
30 |
31 | PrepareArchive(false);
32 |
33 | // Get worksheet details
34 | Worksheet worksheet = new Worksheet();
35 | worksheet.GetWorksheetProperties(this, sheetNumber, sheetName);
36 |
37 | // Delete the file
38 | if (!string.IsNullOrEmpty(worksheet.FileName)) {
39 | ZipArchiveEntry entry = this.Archive.GetEntry(worksheet.FileName);
40 | if (entry != null) {
41 | entry.Delete();
42 | }
43 |
44 | if (this.DeleteWorksheets == null) {
45 | this.DeleteWorksheets = new List();
46 | }
47 | this.DeleteWorksheets.Add(worksheet.Index);
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Read.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Xml.Linq;
6 |
7 | namespace FastExcel {
8 | public partial class FastExcel {
9 | public Worksheet Read(int sheetNumber, int existingHeadingRows = 0) {
10 | return Read(sheetNumber, null, existingHeadingRows);
11 | }
12 |
13 | public Worksheet Read(string sheetName, int existingHeadingRows = 0) {
14 | return Read(null, sheetName, existingHeadingRows);
15 | }
16 |
17 | private Worksheet Read(int? sheetNumber = null, string sheetName = null, int existingHeadingRows = 0) {
18 | Worksheet worksheet = null;
19 | if (_worksheets == null) {
20 | worksheet = new Worksheet(this);
21 | worksheet.Read(sheetNumber, sheetName, existingHeadingRows);
22 | } else {
23 | worksheet = (from w in Worksheets
24 | where (sheetNumber.HasValue && sheetNumber.Value == w.Index) ||
25 | (sheetName == w.Name)
26 | select w).SingleOrDefault();
27 | worksheet.Read(existingHeadingRows);
28 | }
29 | return worksheet;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Update.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Linq;
9 |
10 | namespace FastExcel {
11 | public partial class FastExcel {
12 | ///
13 | /// Update the worksheet
14 | ///
15 | /// The worksheet
16 | /// eg 1,2,4
17 | public void Update(Worksheet data, int sheetNumber) {
18 | this.Update(data, sheetNumber, null);
19 | }
20 |
21 | ///
22 | /// Update the worksheet
23 | ///
24 | /// The worksheet
25 | /// eg. Sheet1, Sheet2
26 | public void Update(Worksheet data, string sheetName) {
27 | this.Update(data, null, sheetName);
28 | }
29 |
30 | private void Update(Worksheet data, int? sheetNumber = null, string sheetName = null) {
31 | CheckFiles();
32 | PrepareArchive();
33 |
34 | Worksheet currentData = this.Read(sheetNumber, sheetName);
35 | currentData.Merge(data);
36 | this.Write(currentData);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Worksheets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Xml.Linq;
8 |
9 | namespace FastExcel {
10 | public partial class FastExcel {
11 | private Worksheet[] _worksheets;
12 |
13 | ///
14 | /// List of worksheets, loaded on first access of property
15 | ///
16 | public Worksheet[] Worksheets {
17 | get {
18 | if (_worksheets != null) {
19 | return _worksheets;
20 | } else {
21 | _worksheets = GetWorksheetProperties();
22 | return _worksheets;
23 | }
24 | }
25 | }
26 |
27 | private Worksheet[] GetWorksheetProperties() {
28 | CheckFiles();
29 | PrepareArchive(false);
30 |
31 | var worksheets = new List();
32 | using (Stream stream = this.Archive.GetEntry("xl/workbook.xml").Open()) {
33 | XDocument document = XDocument.Load(stream);
34 |
35 | if (document == null) {
36 | throw new Exception("Unable to load workbook.xml");
37 | }
38 |
39 | List sheetsElements = document.Descendants().Where(d => d.Name.LocalName == "sheet").ToList();
40 |
41 | foreach (var sheetElement in sheetsElements) {
42 | var worksheet = new Worksheet(this);
43 | worksheet.Index = sheetsElements.IndexOf(sheetElement) + 1;
44 |
45 | worksheet.Name = (from attribute in sheetElement.Attributes()
46 | where attribute.Name == "name"
47 | select attribute.Value).FirstOrDefault();
48 |
49 | worksheets.Add(worksheet);
50 | }
51 | }
52 | return worksheets.ToArray();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/FastExcel.Write.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Linq;
9 |
10 | namespace FastExcel {
11 | public partial class FastExcel {
12 | ///
13 | /// Write data to a sheet
14 | ///
15 | /// A dataset
16 | public void Write(Worksheet worksheet) {
17 | this.Write(worksheet, null, null);
18 | }
19 |
20 | ///
21 | /// Write data to a sheet
22 | ///
23 | /// A dataset
24 | /// The number of the sheet starting at 1
25 | /// How many rows in the template sheet you would like to keep
26 | public void Write(Worksheet worksheet, int sheetNumber, int existingHeadingRows = 0) {
27 | this.Write(worksheet, sheetNumber, null, existingHeadingRows);
28 | }
29 |
30 | ///
31 | /// Write data to a sheet
32 | ///
33 | /// A dataset
34 | /// The display name of the sheet
35 | /// How many rows in the template sheet you would like to keep
36 | public void Write(Worksheet worksheet, string sheetName, int existingHeadingRows = 0) {
37 | this.Write(worksheet, null, sheetName, existingHeadingRows);
38 | }
39 |
40 | ///
41 | /// Write a list of objects to a sheet
42 | ///
43 | /// Row Object
44 | /// IEnumerable list of objects
45 | /// The number of the sheet starting at 1
46 | /// How many rows in the template sheet you would like to keep
47 | public void Write(IEnumerable rows, int sheetNumber, int existingHeadingRows = 0) {
48 | Worksheet data = new Worksheet();
49 | data.PopulateRows(rows);
50 | this.Write(data, sheetNumber, null, existingHeadingRows);
51 | }
52 |
53 | ///
54 | /// Write a list of objects to a sheet
55 | ///
56 | /// Row Object
57 | /// IEnumerable list of objects
58 | /// The display name of the sheet
59 | /// How many rows in the template sheet you would like to keep
60 | public void Write(IEnumerable rows, string sheetName, int existingHeadingRows = 0) {
61 | Worksheet data = new Worksheet();
62 | data.PopulateRows(rows, existingHeadingRows);
63 | this.Write(data, null, sheetName, existingHeadingRows);
64 | }
65 |
66 | ///
67 | /// Write a list of objects to a sheet
68 | ///
69 | /// Row Object
70 | /// IEnumerable list of objects
71 | /// The number of the sheet starting at 1
72 | /// Use property names from object list as headings
73 | public void Write(IEnumerable objectList, int sheetNumber, bool usePropertiesAsHeadings) {
74 | Worksheet data = new Worksheet();
75 | data.PopulateRows(objectList, 0, usePropertiesAsHeadings);
76 | this.Write(data, sheetNumber, null, 0);
77 | }
78 |
79 | ///
80 | /// Write a list of objects to a sheet
81 | ///
82 | /// Row Object
83 | /// IEnumerable list of objects
84 | /// The display name of the sheet
85 | /// Use property names from object list as headings
86 | public void Write(IEnumerable rows, string sheetName, bool usePropertiesAsHeadings) {
87 | Worksheet data = new Worksheet();
88 | data.PopulateRows(rows, 0, usePropertiesAsHeadings);
89 | this.Write(data, null, sheetName, 0);
90 | }
91 |
92 | private void Write(Worksheet worksheet, int? sheetNumber = null, string sheetName = null, int existingHeadingRows = 0) {
93 | CheckFiles();
94 |
95 | try {
96 | if (!this.UpdateExisting) {
97 | File.Copy(this.TemplateFile.FullName, this.ExcelFile.FullName);
98 | }
99 | } catch (Exception ex) {
100 | throw new Exception("Could not copy template to output file path", ex);
101 | }
102 |
103 | PrepareArchive();
104 |
105 | // Open worksheet
106 | worksheet.GetWorksheetProperties(this, sheetNumber, sheetName);
107 | worksheet.ExistingHeadingRows = existingHeadingRows;
108 |
109 | if (this.Archive.Mode != ZipArchiveMode.Update) {
110 | throw new Exception("FastExcel is in ReadOnly mode so cannot perform a write");
111 | }
112 |
113 | // Check if ExistingHeadingRows will be overridden by the dataset
114 | if (worksheet.ExistingHeadingRows != 0 && worksheet.Rows.Where(r => r.RowNumber <= worksheet.ExistingHeadingRows).Any()) {
115 | throw new Exception("Existing Heading Rows was specified but some or all will be overridden by data rows. Check DataSet.Row.RowNumber against ExistingHeadingRows");
116 | }
117 |
118 | using (Stream stream = this.Archive.GetEntry(worksheet.FileName).Open()) {
119 | // Open worksheet and read the data at the top and bottom of the sheet
120 | StreamReader streamReader = new StreamReader(stream);
121 | worksheet.ReadHeadersAndFooters(streamReader, ref worksheet);
122 |
123 | //Set the stream to the start
124 | stream.Position = 0;
125 |
126 | // Open the stream so we can override all content of the sheet
127 | StreamWriter streamWriter = new StreamWriter(stream);
128 |
129 | // TODO instead of saving the headers then writing them back get position where the headers finish then write from there
130 | streamWriter.Write(worksheet.Headers);
131 | if (!worksheet.Template) {
132 | worksheet.Headers = null;
133 | }
134 |
135 | this.SharedStrings.ReadWriteMode = true;
136 |
137 | // Add Rows
138 | foreach (Row row in worksheet.Rows) {
139 | streamWriter.Write(row.ToXmlString(this.SharedStrings));
140 | }
141 | this.SharedStrings.ReadWriteMode = false;
142 |
143 | //Add Footers
144 | streamWriter.Write(worksheet.Footers);
145 | if (!worksheet.Template) {
146 | worksheet.Footers = null;
147 | }
148 | streamWriter.Flush();
149 | }
150 | }
151 |
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/Row.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Xml.Linq;
7 |
8 | namespace FastExcel
9 | {
10 | ///
11 | /// Row that contains the Cells
12 | ///
13 | public class Row
14 | {
15 | ///
16 | /// The Row Number (Row numbers start at 1)
17 | ///
18 | public int RowNumber { get; set; }
19 |
20 | ///
21 | /// The collection of cells for this row
22 | ///
23 | public IEnumerable Cells { get; set; }
24 |
25 | ///
26 | /// Create a new Row
27 | ///
28 | /// Row number starting with 1
29 | /// Cells on this row
30 | public Row(int rowNumber, IEnumerable cells)
31 | {
32 | if (rowNumber <= 0)
33 | {
34 | throw new Exception("Row numbers starting at 1");
35 | }
36 | this.RowNumber = rowNumber;
37 | this.Cells = cells;
38 | }
39 |
40 | public Row(XElement rowElement, SharedStrings sharedStrings)
41 | {
42 | try
43 | {
44 | this.RowNumber = (from a in rowElement.Attributes("r")
45 | select int.Parse(a.Value)).First();
46 | }
47 | catch (Exception ex)
48 | {
49 | throw new Exception("Row Number not found", ex);
50 | }
51 |
52 | if (rowElement.HasElements)
53 | {
54 | this.Cells = GetCells(rowElement, sharedStrings);
55 | }
56 | }
57 |
58 | private IEnumerable GetCells(XElement rowElement, SharedStrings sharedStrings)
59 | {
60 | foreach (XElement cellElement in rowElement.Elements())
61 | {
62 | Cell cell = new Cell(cellElement, sharedStrings);
63 | if (cell.Value != null)
64 | {
65 | yield return cell;
66 | }
67 | }
68 | }
69 |
70 | internal StringBuilder ToXmlString(SharedStrings sharedStrings)
71 | {
72 | StringBuilder row = new StringBuilder();
73 |
74 | if (this.Cells != null && Cells.Any())
75 | {
76 | row.AppendFormat("", this.RowNumber);
77 | try
78 | {
79 | foreach (Cell cell in this.Cells)
80 | {
81 | row.Append(cell.ToXmlString(sharedStrings, this.RowNumber));
82 | }
83 | }
84 | finally
85 | {
86 | row.Append(" ");
87 | }
88 | }
89 |
90 | return row;
91 | }
92 |
93 | ///
94 | /// Merge this row and the passed one togeather
95 | ///
96 | /// Row to be merged into this one
97 | internal void Merge(Row row)
98 | {
99 | // Merge cells
100 | List outputList = new List();
101 | foreach (var cell in this.Cells.Union(row.Cells).GroupBy(c => c.ColumnNumber))
102 | {
103 | int count = cell.Count();
104 | if (count == 1)
105 | {
106 | outputList.Add(cell.First());
107 | }
108 | else
109 | {
110 | cell.First().Merge(cell.Skip(1).First());
111 |
112 | outputList.Add(cell.First());
113 | }
114 | }
115 |
116 | // Sort
117 | this.Cells = (from c in outputList
118 | orderby c.ColumnNumber
119 | select c);
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/SharedStrings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Xml.Linq;
9 |
10 | namespace FastExcel
11 | {
12 | ///
13 | /// Read and update xl/sharedStrings.xml file
14 | ///
15 | public class SharedStrings
16 | {
17 | //A dictionary is a lot faster than a list
18 | private Dictionary StringDictionary { get; set; }
19 | private Dictionary StringArray { get; set; }
20 |
21 | private bool SharedStringsExists { get; set; }
22 | private ZipArchive ZipArchive { get; set; }
23 |
24 | public bool PendingChanges { get; private set; }
25 |
26 | public bool ReadWriteMode { get; set; }
27 |
28 | internal SharedStrings(ZipArchive archive)
29 | {
30 | this.ZipArchive = archive;
31 |
32 | this.SharedStringsExists = true;
33 |
34 | if (!this.ZipArchive.Entries.Where(entry => entry.FullName == "xl/sharedStrings.xml").Any())
35 | {
36 | this.StringDictionary = new Dictionary();
37 | this.SharedStringsExists = false;
38 | return;
39 | }
40 |
41 | using (Stream stream = this.ZipArchive.GetEntry("xl/sharedStrings.xml").Open())
42 | {
43 | if (stream == null)
44 | {
45 | this.StringDictionary = new Dictionary();
46 | this.SharedStringsExists = false;
47 | return;
48 | }
49 |
50 | XDocument document = XDocument.Load(stream);
51 |
52 | if (document == null)
53 | {
54 | this.StringDictionary = new Dictionary();
55 | this.SharedStringsExists = false;
56 | return;
57 | }
58 |
59 | int i = 0;
60 | this.StringDictionary = document.Descendants().Where(d => d.Name.LocalName == "t").Select(e => e.Value).ToDictionary(k=> k,v => i++);
61 | }
62 | }
63 |
64 | internal int AddString(string stringValue)
65 | {
66 | if (this.StringDictionary.ContainsKey(stringValue))
67 | {
68 | return this.StringDictionary[stringValue];
69 | }
70 | else
71 | {
72 | this.PendingChanges = true;
73 | this.StringDictionary.Add(stringValue, this.StringDictionary.Count);
74 |
75 | // Clear String Array used for retrieval
76 | if (this.ReadWriteMode && this.StringArray != null)
77 | {
78 | this.StringArray.Add(this.StringDictionary.Count - 1, stringValue);
79 | }
80 | else
81 | {
82 | this.StringArray = null;
83 | }
84 |
85 | return this.StringDictionary.Count - 1;
86 | }
87 | }
88 |
89 | internal void Write()
90 | {
91 | // Only update if changes were made
92 | if (!this.PendingChanges)
93 | {
94 | return;
95 | }
96 |
97 | StreamWriter streamWriter = null;
98 | try
99 | {
100 | if (this.SharedStringsExists)
101 | {
102 | streamWriter = new StreamWriter(this.ZipArchive.GetEntry("xl/sharedStrings.xml").Open());
103 | }
104 | else
105 | {
106 | streamWriter = new StreamWriter(this.ZipArchive.CreateEntry("xl/sharedStrings.xml").Open());
107 | }
108 |
109 | // TODO instead of saving the headers then writing them back get position where the headers finish then write from there
110 |
111 | /* Note: the count attribute value is wrong, it is the number of times strings are used thoughout the workbook it is different to the unique count
112 | * but because this library is about speed and Excel does not seem to care I am not going to fix it because I would need to read the whole workbook
113 | */
114 |
115 | streamWriter.Write(string.Format("" +
116 | "", this.StringDictionary.Count));
117 |
118 | // Add Rows
119 | foreach (var stringValue in this.StringDictionary)
120 | {
121 | streamWriter.Write(string.Format("{0}", stringValue.Key));
122 | }
123 |
124 | //Add Footers
125 | streamWriter.Write("");
126 | streamWriter.Flush();
127 | }
128 | finally
129 | {
130 | streamWriter.Dispose();
131 | this.PendingChanges = false;
132 | }
133 | }
134 |
135 | internal string GetString(string position)
136 | {
137 | int pos = 0;
138 | if (int.TryParse(position, out pos))
139 | {
140 | return GetString(pos + 1);
141 | }
142 | else
143 | {
144 | // TODO: should I throw an error? this is a corrupted excel document
145 | return string.Empty;
146 | }
147 | }
148 |
149 | internal string GetString(int position)
150 | {
151 | if (this.StringArray == null)
152 | {
153 | this.StringArray = this.StringDictionary.ToDictionary(kv => kv.Value, kv => kv.Key);
154 | }
155 |
156 | return this.StringArray[position - 1];
157 | }
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/GenPg/FastExcel/WorksheetAddSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FastExcel
8 | {
9 | internal class WorksheetAddSettings
10 | {
11 | public string Name { get; set; }
12 |
13 | public int SheetId { get; set; }
14 |
15 | public int InsertAfterSheetId { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/GenPg/GenPg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | netcoreapp2.1
5 | true
6 | true
7 | true
8 | 2881099
9 | 2881099
10 | dotnetGen
11 | 用于快速创建和更新 .NETCore 2.1 + PostgreSQL 项目,非常合适敏捷开发; dotnet tool install -g GenPg
12 | https://github.com/2881099/dotnetgen_postgresql
13 | https://github.com/2881099/dotnetgen_postgresql
14 | 1.1.14
15 | 生成器,postgresql,core,pgsql
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/GenPg/Lib/IniHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.Specialized;
4 | using System.Text;
5 | using System.Text.RegularExpressions;
6 | using System.Threading;
7 | using System.IO;
8 |
9 | public class IniHelper {
10 | private static Dictionary _cache = new Dictionary();
11 | private static Dictionary _watcher = new Dictionary();
12 | private static object _lock = new object();
13 |
14 | private static object loadAndCache(string path) {
15 | path = TranslateUrl(path);
16 | object ret = null;
17 | if (!_cache.TryGetValue(path, out ret)) {
18 | object value2 = LoadIniNotCache(path);
19 | string dir = Path.GetDirectoryName(path);
20 | string name = Path.GetFileName(path);
21 | FileSystemWatcher fsw = new FileSystemWatcher(dir, name);
22 | fsw.IncludeSubdirectories = false;
23 | fsw.Changed += watcher_handler;
24 | fsw.Renamed += watcher_handler;
25 | fsw.EnableRaisingEvents = false;
26 | lock (_lock) {
27 | if (!_cache.TryGetValue(path, out ret)) {
28 | _cache.Add(path, ret = value2);
29 | _watcher.Add(path, fsw);
30 | fsw.EnableRaisingEvents = true;
31 | } else {
32 | fsw.Dispose();
33 | }
34 | }
35 | }
36 | return ret;
37 | }
38 | private static void watcher_handler(object sender, FileSystemEventArgs e) {
39 | lock (_lock) {
40 | _cache.Remove(e.FullPath);
41 | FileSystemWatcher fsw = null;
42 | if (_watcher.TryGetValue(e.FullPath, out fsw)) {
43 | fsw.EnableRaisingEvents = false;
44 | fsw.Dispose();
45 | }
46 | }
47 | }
48 |
49 | public static Dictionary LoadIni(string path) {
50 | return loadAndCache(path) as Dictionary;
51 | }
52 | public static Dictionary LoadIniNotCache(string path) {
53 | Dictionary ret = new Dictionary();
54 | string[] lines = ReadTextFile(path).Split(new string[] { "\n" }, StringSplitOptions.None);
55 | string key = "";
56 | foreach (string line2 in lines) {
57 | string line = line2.Trim();
58 | if (string.IsNullOrEmpty(line) || line.StartsWith("#") || line.StartsWith(";")) continue;
59 |
60 | Match m = Regex.Match(line, @"^\[([^\]]+)\]$");
61 | if (m.Success) {
62 | key = m.Groups[1].Value;
63 | continue;
64 | }
65 | if (!ret.ContainsKey(key)) ret.Add(key, new NameValueCollection());
66 | string[] kv = line.Split(new char[] { '=' }, 2);
67 | if (!string.IsNullOrEmpty(kv[0])) {
68 | ret[key][kv[0]] = kv.Length > 1 ? kv[1] : null;
69 | }
70 | }
71 | return ret;
72 | }
73 |
74 | public static string ReadTextFile(string path) {
75 | byte[] bytes = ReadFile(path);
76 | return Encoding.UTF8.GetString(bytes).TrimStart((char)65279);
77 | }
78 | public static byte[] ReadFile(string path) {
79 | if (File.Exists(path)) {
80 | string destFileName = Path.GetTempFileName();
81 | File.Copy(path, destFileName, true);
82 | int read = 0;
83 | byte[] data = new byte[1024];
84 | using (MemoryStream ms = new MemoryStream()) {
85 | using (FileStream fs = new FileStream(destFileName, FileMode.OpenOrCreate, FileAccess.Read)) {
86 | do {
87 | read = fs.Read(data, 0, data.Length);
88 | if (read <= 0) break;
89 | ms.Write(data, 0, read);
90 | } while (true);
91 | }
92 | File.Delete(destFileName);
93 | data = ms.ToArray();
94 | }
95 | return data;
96 | }
97 | return new byte[] { };
98 | }
99 |
100 | public static string TranslateUrl(string url) {
101 | return TranslateUrl(url, null);
102 | }
103 | public static string TranslateUrl(string url, string baseDir) {
104 | if (string.IsNullOrEmpty(baseDir)) baseDir = AppContext.BaseDirectory + "/";
105 | if (string.IsNullOrEmpty(url)) return Path.GetDirectoryName(baseDir);
106 | if (url.StartsWith("~/")) url = url.Substring(1);
107 | if (url.StartsWith("/")) return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(baseDir), url.TrimStart('/')));
108 | if (url.StartsWith("\\")) return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(baseDir), url.TrimStart('\\')));
109 | if (url.IndexOf(":\\") != -1) return url;
110 | return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(baseDir), url));
111 | }
112 | }
--------------------------------------------------------------------------------
/GenPg/Lib/JSDecoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Text.RegularExpressions;
4 |
5 | public class JSDecoder {
6 | private const byte STATE_COPY_INPUT = 100;
7 | private const byte STATE_READLEN = 101;
8 | private const byte STATE_DECODE = 102;
9 | private const byte STATE_UNESCAPE = 103;
10 |
11 | private static byte[] _pickEncoding;
12 | private static byte[] _rawData;
13 | private static byte[] _digits = new byte[123];
14 | private static byte[][] _transformed = new byte[3][];
15 |
16 | static JSDecoder() {
17 | InitArrayData();
18 | }
19 |
20 | private static void InitArrayData() {
21 | _pickEncoding = new byte[] {
22 | 1, 2, 0, 1, 2, 0, 2, 0, 0, 2, 0, 2, 1, 0, 2, 0,
23 | 1, 0, 2, 0, 1, 1, 2, 0, 0, 2, 1, 0, 2, 0, 0, 2,
24 | 1, 1, 0, 2, 0, 2, 0, 1, 0, 1, 1, 2, 0, 1, 0, 2,
25 | 1, 0, 2, 0, 1, 1, 2, 0, 0, 1, 1, 2, 0, 1, 0, 2
26 | };
27 |
28 | _rawData = new byte[] {
29 | 0x64,0x37,0x69, 0x50,0x7E,0x2C, 0x22,0x5A,0x65, 0x4A,0x45,0x72,
30 | 0x61,0x3A,0x5B, 0x5E,0x79,0x66, 0x5D,0x59,0x75, 0x5B,0x27,0x4C,
31 | 0x42,0x76,0x45, 0x60,0x63,0x76, 0x23,0x62,0x2A, 0x65,0x4D,0x43,
32 | 0x5F,0x51,0x33, 0x7E,0x53,0x42, 0x4F,0x52,0x20, 0x52,0x20,0x63,
33 | 0x7A,0x26,0x4A, 0x21,0x54,0x5A, 0x46,0x71,0x38, 0x20,0x2B,0x79,
34 | 0x26,0x66,0x32, 0x63,0x2A,0x57, 0x2A,0x58,0x6C, 0x76,0x7F,0x2B,
35 | 0x47,0x7B,0x46, 0x25,0x30,0x52, 0x2C,0x31,0x4F, 0x29,0x6C,0x3D,
36 | 0x69,0x49,0x70, 0x3F,0x3F,0x3F, 0x27,0x78,0x7B, 0x3F,0x3F,0x3F,
37 | 0x67,0x5F,0x51, 0x3F,0x3F,0x3F, 0x62,0x29,0x7A, 0x41,0x24,0x7E,
38 | 0x5A,0x2F,0x3B, 0x66,0x39,0x47, 0x32,0x33,0x41, 0x73,0x6F,0x77,
39 | 0x4D,0x21,0x56, 0x43,0x75,0x5F, 0x71,0x28,0x26, 0x39,0x42,0x78,
40 | 0x7C,0x46,0x6E, 0x53,0x4A,0x64, 0x48,0x5C,0x74, 0x31,0x48,0x67,
41 | 0x72,0x36,0x7D, 0x6E,0x4B,0x68, 0x70,0x7D,0x35, 0x49,0x5D,0x22,
42 | 0x3F,0x6A,0x55, 0x4B,0x50,0x3A, 0x6A,0x69,0x60, 0x2E,0x23,0x6A,
43 | 0x7F,0x09,0x71, 0x28,0x70,0x6F, 0x35,0x65,0x49, 0x7D,0x74,0x5C,
44 | 0x24,0x2C,0x5D, 0x2D,0x77,0x27, 0x54,0x44,0x59, 0x37,0x3F,0x25,
45 | 0x7B,0x6D,0x7C, 0x3D,0x7C,0x23, 0x6C,0x43,0x6D, 0x34,0x38,0x28,
46 | 0x6D,0x5E,0x31, 0x4E,0x5B,0x39, 0x2B,0x6E,0x7F, 0x30,0x57,0x36,
47 | 0x6F,0x4C,0x54, 0x74,0x34,0x34, 0x6B,0x72,0x62, 0x4C,0x25,0x4E,
48 | 0x33,0x56,0x30, 0x56,0x73,0x5E, 0x3A,0x68,0x73, 0x78,0x55,0x09,
49 | 0x57,0x47,0x4B, 0x77,0x32,0x61, 0x3B,0x35,0x24, 0x44,0x2E,0x4D,
50 | 0x2F,0x64,0x6B, 0x59,0x4F,0x44, 0x45,0x3B,0x21, 0x5C,0x2D,0x37,
51 | 0x68,0x41,0x53, 0x36,0x61,0x58, 0x58,0x7A,0x48, 0x79,0x22,0x2E,
52 | 0x09,0x60,0x50, 0x75,0x6B,0x2D, 0x38,0x4E,0x29, 0x55,0x3D,0x3F
53 | };
54 |
55 | for (byte i = 0; i < 3; i++) _transformed[i] = new byte[288];
56 | for (byte i = 31; i < 127; i++) for (byte j = 0; j < 3; j++) _transformed[j][_rawData[(i - 31) * 3 + j]] = i == 31 ? (byte)9 : i;
57 |
58 | for (byte i = 0; i < 26; i++) {
59 | _digits[65 + i] = i;
60 | _digits[97 + i] = (byte)(i + 26);
61 | }
62 |
63 | for (byte i = 0; i < 10; i++)
64 | _digits[48 + i] = (byte)(i + 52);
65 |
66 | _digits[43] = 62;
67 | _digits[47] = 63;
68 | }
69 |
70 | private static string UnEscape(string s) {
71 | string escapes = "#&!*$";
72 | string escaped = "\r\n<>@";
73 |
74 | if ((int)s.ToCharArray()[0] > 126) return s;
75 | if (escapes.IndexOf(s) != -1) return escaped.Substring(escapes.IndexOf(s), 1);
76 | return "?";
77 | }
78 |
79 | private static int DecodeBase64(string s) {
80 | int val = 0;
81 | byte[] bs = Encoding.UTF8.GetBytes(s);
82 |
83 | val += ((int)_digits[bs[0]] << 2);
84 | val += (_digits[bs[1]] >> 4);
85 | val += (_digits[bs[1]] & 0xf) << 12;
86 | val += ((_digits[bs[2]] >> 2) << 8);
87 | val += ((_digits[bs[2]] & 0x3) << 22);
88 | val += (_digits[bs[3]] << 16);
89 | return val;
90 | }
91 |
92 | public static string Decode(string encodingString) {
93 | string marker = "#@~^";
94 | int stringIndex = 0;
95 | int scriptIndex = -1;
96 | int unEncodingIndex = 0;
97 | string strChar = "";
98 | string getCodeString = "";
99 | int unEncodinglength = 0;
100 | int state = STATE_COPY_INPUT;
101 | string unEncodingString = "";
102 |
103 | try {
104 | while (state != 0) {
105 | switch (state) {
106 | case STATE_COPY_INPUT:
107 |
108 | scriptIndex = encodingString.IndexOf(marker, stringIndex);
109 | if (scriptIndex != -1) {
110 | unEncodingString += encodingString.Substring(stringIndex, scriptIndex);
111 | scriptIndex += marker.Length;
112 | state = STATE_READLEN;
113 | } else {
114 | stringIndex = stringIndex == 0 ? 0 : stringIndex;
115 | unEncodingString += encodingString.Substring(stringIndex);
116 | state = 0;
117 | }
118 | break;
119 | case STATE_READLEN:
120 |
121 | getCodeString = encodingString.Substring(scriptIndex, 6);
122 | unEncodinglength = DecodeBase64(getCodeString);
123 | scriptIndex += 8;
124 | state = STATE_DECODE;
125 | break;
126 | case STATE_DECODE:
127 |
128 | if (unEncodinglength == 0) {
129 | stringIndex = scriptIndex + "DQgAAA==^#~@".Length;
130 | unEncodingIndex = 0;
131 | state = STATE_COPY_INPUT;
132 | } else {
133 | strChar = encodingString.Substring(scriptIndex, 1);
134 | if (strChar == "@") state = STATE_UNESCAPE;
135 | else {
136 | int b = (int)strChar.ToCharArray()[0];
137 | if (b < 0xFF) {
138 | unEncodingString += (char)_transformed[_pickEncoding[unEncodingIndex % 64]][b];
139 | unEncodingIndex++;
140 | } else {
141 | unEncodingString += strChar;
142 | }
143 | scriptIndex++;
144 | unEncodinglength--;
145 | }
146 | }
147 | break;
148 | case STATE_UNESCAPE:
149 |
150 | unEncodingString += UnEscape(encodingString.Substring(++scriptIndex, 1));
151 | scriptIndex++;
152 | unEncodinglength -= 2;
153 | unEncodingIndex++;
154 | state = STATE_DECODE;
155 | break;
156 | }
157 | }
158 | } catch { }
159 | string Pattern;
160 | Pattern = "(JScript|VBscript).encode";
161 | unEncodingString = Regex.Replace(unEncodingString, Pattern, "", RegexOptions.IgnoreCase);
162 | return unEncodingString;
163 | }
164 | }
--------------------------------------------------------------------------------
/GenPg/Model/BuildInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Model {
4 |
5 | [Serializable]
6 | public class BuildInfo {
7 |
8 | private string _path;
9 | private byte[] _data;
10 |
11 | public BuildInfo() { }
12 | public BuildInfo(string path, byte[] data) {
13 | _path = path;
14 | _data = data;
15 | }
16 |
17 | public string Path {
18 | get { return _path; }
19 | }
20 |
21 | public byte[] Data {
22 | get { return _data; }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/GenPg/Model/ClientInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ClientInfo {
9 | private string _server;
10 | private int _port;
11 | private string _username;
12 | private string _password;
13 | private string _database;
14 |
15 | public ClientInfo(string server, int port, string username, string password) {
16 | _server = server;
17 | _port = port;
18 | _username = username;
19 | _password = password;
20 | }
21 |
22 | public string Server {
23 | get { return _server; }
24 | }
25 | public int Port {
26 | get { return _port; }
27 | }
28 | public string Username {
29 | get { return _username; }
30 | }
31 | public string Password {
32 | get { return _password; }
33 | }
34 | public string Database {
35 | get { return _database; }
36 | set { _database = value; }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/GenPg/Model/ColumnInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ColumnInfo {
9 |
10 | private string _name;
11 | private NpgsqlDbType _type;
12 | private long _length;
13 | private string _sqlType;
14 | private string _csType;
15 | private DataSort _orderby;
16 | private bool _isNullable;
17 | private bool _isIdentity;
18 | private bool _isClustered;
19 | private bool _isPrimaryKey;
20 | private int _attndims;
21 | private int _attnum;
22 |
23 | public ColumnInfo() { }
24 | public ColumnInfo(string name, NpgsqlDbType type, long length, string sqlType, string csType, DataSort orderby, bool isNullable, bool isIdentity, bool isClustered, bool isPrimaryKey, int attndims, int attnum) {
25 | _name = name;
26 | _type = type;
27 | _length = length;
28 | _sqlType = sqlType;
29 | _csType = csType;
30 | _orderby = orderby;
31 | _isNullable = isNullable;
32 | _isIdentity = isIdentity;
33 | _isClustered = isClustered;
34 | _isPrimaryKey = isPrimaryKey;
35 | _attndims = attndims;
36 | _attnum = attnum;
37 | }
38 |
39 | public string Name {
40 | get { return _name; }
41 | set { _name = value; }
42 | }
43 | public NpgsqlDbType Type {
44 | get { return _type; }
45 | set { _type = value; }
46 | }
47 | public long Length {
48 | get { return _length; }
49 | set { _length = value; }
50 | }
51 | public string SqlType {
52 | get { return _sqlType; }
53 | set { _sqlType = value; }
54 | }
55 | public string CsType {
56 | get { return _csType; }
57 | set { _csType = value; }
58 | }
59 | public DataSort Orderby {
60 | get { return _orderby; }
61 | set { _orderby = value; }
62 | }
63 | public bool IsNullable {
64 | get { return _isNullable; }
65 | set { _isNullable = value; }
66 | }
67 | public bool IsIdentity {
68 | get { return _isIdentity; }
69 | set { _isIdentity = value; }
70 | }
71 | public bool IsClustered {
72 | get { return _isClustered; }
73 | set { _isClustered = value; }
74 | }
75 | public bool IsPrimaryKey {
76 | get { return _isPrimaryKey; }
77 | set { _isPrimaryKey = value; }
78 | }
79 | public int Attndims {
80 | get { return _attndims; }
81 | set { _attndims = value; }
82 | }
83 | public int Attnum {
84 | get { return _attnum; }
85 | set { _attnum = value; }
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/GenPg/Model/DataSort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Model {
4 |
5 | [Serializable]
6 | public enum DataSort {
7 | NONE = 0,
8 | ASC = 1,
9 | DESC = 2
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/GenPg/Model/DatabaseInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class DatabaseInfo {
9 |
10 | private string _name;
11 |
12 | public DatabaseInfo() { }
13 | public DatabaseInfo(string name) {
14 | _name = name;
15 | }
16 |
17 | public string Name {
18 | get { return _name; }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/GenPg/Model/ForeignKeyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Collections.Generic;
4 |
5 | namespace Model {
6 |
7 | [Serializable]
8 | public class ForeignKeyInfo {
9 | private TableInfo _table;
10 | private List _columns = new List();
11 |
12 | private TableInfo _referencedTable;
13 | private List _referencedColumns = new List();
14 |
15 | private string _referencedDBName;
16 | private string _referencedTableName;
17 | private List _referencedColumnNames = new List();
18 | private bool _referencedIsPrimaryKey;
19 |
20 | public ForeignKeyInfo(TableInfo table, TableInfo referencedTable) {
21 | _table = table;
22 | _referencedTable = referencedTable;
23 | }
24 | public ForeignKeyInfo(string referencedSln, string referencedTableName, bool referencedIsPK) {
25 | _referencedDBName = referencedSln;
26 | _referencedTableName = referencedTableName;
27 | _referencedIsPrimaryKey = referencedIsPK;
28 | }
29 |
30 | public TableInfo Table {
31 | get { return _table; }
32 | set { _table = value; }
33 | }
34 | public List Columns {
35 | get { return _columns; }
36 | set { _columns = value; }
37 | }
38 |
39 | public TableInfo ReferencedTable {
40 | get { return _referencedTable; }
41 | set { _referencedTable = value; }
42 | }
43 | public List ReferencedColumns {
44 | get { return _referencedColumns; }
45 | set { _referencedColumns = value; }
46 | }
47 |
48 | public string ReferencedDBName {
49 | get { return _referencedDBName; }
50 | set { _referencedDBName = value; }
51 | }
52 | public string ReferencedTableName {
53 | get { return _referencedTableName; }
54 | set { _referencedTableName = value; }
55 | }
56 | public List ReferencedColumnNames {
57 | get { return _referencedColumnNames; }
58 | set { _referencedColumnNames = value; }
59 | }
60 | public bool ReferencedIsPrimaryKey {
61 | get { return _referencedIsPrimaryKey; }
62 | set { _referencedIsPrimaryKey = value; }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/GenPg/Model/TableInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Text.RegularExpressions;
4 | using System.Collections.Generic;
5 |
6 | namespace Model {
7 |
8 | [Serializable]
9 | public class TableInfo {
10 |
11 | private string _id;
12 | private string _owner;
13 | private string _name;
14 | private List _columns = new List();
15 | private List> _uniques = new List>();
16 | private List> _indexes = new List>();
17 | private List _foreignKeys = new List();
18 | private List _identitys = new List();
19 | private List _clustereds = new List();
20 | private List _primaryKeys = new List();
21 | private string _Type;
22 | private bool _IsOutput;
23 |
24 | public TableInfo(string id, string owner, string name, string type) {
25 | _id = id;
26 | _owner = owner;
27 | _name = name;
28 | _Type = type;
29 | }
30 |
31 | public static string GetClassName(string name) {
32 | int rr = 0;
33 | string n = name.StartsWith("public.") ? name.Substring(7) : Regex.Replace(name, @"\.", delegate(Match m) {
34 | if (rr++ > 0) return m.Groups[0].Value;
35 | return "_";
36 | });
37 | return char.IsLetter(n, 0) ? n : string.Concat("_", n);
38 | }
39 | public static string GetEntryName(string name) {
40 | int idx = name.IndexOf('.');
41 | return idx == -1 ? name : name.Substring(idx + 1);
42 | }
43 |
44 | public string Id {
45 | get { return _id; }
46 | }
47 | public string Owner {
48 | get { return _owner; }
49 | }
50 | public string Name {
51 | get { return _name; }
52 | }
53 | public string ClassName {
54 | get {
55 | return GetClassName(_owner.ToLower() + "." + _name);
56 | }
57 | }
58 | public string FullName {
59 | get { return string.IsNullOrEmpty(_owner) ? _name : string.Format("{0}.{1}", _owner, _name); }
60 | }
61 | public string Type {
62 | get { return _Type; }
63 | }
64 |
65 | public List Columns {
66 | get { return _columns; }
67 | }
68 | public List> Uniques {
69 | get {
70 | if (_uniques == null) {
71 |
72 | }
73 | return _uniques;
74 | }
75 | }
76 | public List> Indexes {
77 | get {
78 | if (_indexes == null) {
79 |
80 | }
81 | return _indexes;
82 | }
83 | }
84 | public List ForeignKeys {
85 | get {
86 | if (_foreignKeys == null) {
87 |
88 | }
89 | return _foreignKeys;
90 | }
91 | }
92 | public List PrimaryKeys {
93 | get {
94 | if (_primaryKeys == null) {
95 |
96 | }
97 | return _primaryKeys;
98 | }
99 | }
100 | public List Clustereds {
101 | get {
102 | if (_clustereds == null) {
103 |
104 | }
105 | return _clustereds;
106 | }
107 | }
108 | public List Identitys {
109 | get {
110 | if (_identitys == null) {
111 |
112 | }
113 | return _identitys;
114 | }
115 | }
116 |
117 | public bool IsOutput {
118 | get { return _IsOutput; }
119 | set { _IsOutput = value; }
120 | }
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/GenPg/NPinyin/Pinyin.cs:
--------------------------------------------------------------------------------
1 | /**
2 | * NPinyin包含一个公开类Pinyin,该类实现了取汉字文本首字母、文本对应拼音、以及
3 | * 获取和拼音对应的汉字列表等方法。由于汉字字库大,且多音字较多,因此本组中实现的
4 | * 拼音转换不一定和词语中的字的正确读音完全吻合。但绝大部分是正确的。
5 | *
6 | * 最后感谢百度网友韦祎提供的常用汉字拼音对照表。见下载地址:
7 | * http://wenku.baidu.com/view/d725f4335a8102d276a22f46.html
8 | *
9 | * 最后,我想简要地说明一下我的设计思路:
10 | * 首先,我将汉字按拼音分组后建立一个字符串数组(见PyCode.codes),然后使用程序
11 | * 将PyCode.codes中每一个汉字通过其编码值使用散列函数:
12 | *
13 | * f(x) = x % PyCode.codes.Length
14 | * {
15 | * g(f(x)) = pos(x)
16 | *
17 | * 其中, pos(x)为字符x所属字符串所在的PyCode.codes的数组下标, 然后散列到同
18 | * PyCode.codes长度相同长度的一个散列表中PyHash.hashes)。
19 | * 当检索一个汉字的拼音时,首先从PyHash.hashes中获取和
20 | * 对应的PyCode.codes中数组下标,然后从对应字符串查找,当到要查找的字符时,字符
21 | * 串的前6个字符即包含了该字的拼音。
22 | *
23 | * 此种方法的好处一是节约了存储空间,二是兼顾了查询效率。
24 | *
25 | * 如有意见,请与我联系反馈。我的邮箱是:qzyzwsy@gmail.com
26 | *
27 | * 汪思言 2011年1月3日凌晨
28 | * */
29 |
30 | /*
31 | * v0.2.x的变化
32 | * =================================================================
33 | * 1、增加对不同编码格式文本的支持,同时增加编码转换方法Pinyin.ConvertEncoding
34 | * 2、重构单字符拼音的获取,未找到拼音时返回字符本身.
35 | *
36 | * 汪思言 2012年7月23日晚
37 | *
38 | */
39 |
40 | using System;
41 | using System.Collections.Generic;
42 | using System.Text;
43 |
44 | namespace NPinyin
45 | {
46 | public static class Pinyin
47 | {
48 | ///
49 | /// 取中文文本的拼音首字母
50 | ///
51 | /// 编码为UTF8的文本
52 | /// 返回中文对应的拼音首字母
53 |
54 | public static string GetInitials(string text)
55 | {
56 | text = text.Trim();
57 | StringBuilder chars = new StringBuilder();
58 | for (var i = 0; i < text.Length; ++i)
59 | {
60 | string py = GetPinyin(text[i]);
61 | if (py != "") chars.Append(py[0]);
62 | }
63 |
64 | return chars.ToString().ToUpper();
65 | }
66 |
67 |
68 | ///
69 | /// 取中文文本的拼音首字母
70 | ///
71 | /// 文本
72 | /// 源文本的编码
73 | /// 返回encoding编码类型中文对应的拼音首字母
74 | public static string GetInitials(string text, Encoding encoding)
75 | {
76 | string temp = ConvertEncoding(text, encoding, Encoding.UTF8);
77 | return ConvertEncoding(GetInitials(temp), Encoding.UTF8, encoding);
78 | }
79 |
80 |
81 |
82 | ///
83 | /// 取中文文本的拼音
84 | ///
85 | /// 编码为UTF8的文本
86 | /// 返回中文文本的拼音
87 |
88 | public static string GetPinyin(string text)
89 | {
90 | StringBuilder sbPinyin = new StringBuilder();
91 | for (var i = 0; i < text.Length; ++i)
92 | {
93 | string py = GetPinyin(text[i]);
94 | if (py != "") sbPinyin.Append(py);
95 | sbPinyin.Append(" ");
96 | }
97 |
98 | return sbPinyin.ToString().Trim();
99 | }
100 |
101 | ///
102 | /// 取中文文本的拼音
103 | ///
104 | /// 编码为UTF8的文本
105 | /// 源文本的编码
106 | /// 返回encoding编码类型的中文文本的拼音
107 | public static string GetPinyin(string text, Encoding encoding)
108 | {
109 | string temp = ConvertEncoding(text.Trim(), encoding, Encoding.UTF8);
110 | return ConvertEncoding(GetPinyin(temp), Encoding.UTF8, encoding);
111 | }
112 |
113 | ///
114 | /// 取和拼音相同的汉字列表
115 | ///
116 | /// 编码为UTF8的拼音
117 | /// 取拼音相同的汉字列表,如拼音“ai”将会返回“唉爱……”等
118 | public static string GetChineseText(string pinyin)
119 | {
120 | string key = pinyin.Trim().ToLower();
121 |
122 | foreach (string str in PyCode.codes)
123 | {
124 | if (str.StartsWith(key + " ") || str.StartsWith(key + ":"))
125 | return str.Substring(7);
126 | }
127 |
128 | return "";
129 | }
130 |
131 |
132 | ///
133 | /// 取和拼音相同的汉字列表,编码同参数encoding
134 | ///
135 | /// 编码为encoding的拼音
136 | /// 编码
137 | /// 返回编码为encoding的拼音为pinyin的汉字列表,如拼音“ai”将会返回“唉爱……”等
138 | public static string GetChineseText(string pinyin, Encoding encoding)
139 | {
140 | string text = ConvertEncoding(pinyin, encoding, Encoding.UTF8);
141 | return ConvertEncoding(GetChineseText(text), Encoding.UTF8, encoding);
142 | }
143 |
144 |
145 |
146 | ///
147 | /// 返回单个字符的汉字拼音
148 | ///
149 | /// 编码为UTF8的中文字符
150 | /// ch对应的拼音
151 | public static string GetPinyin(char ch)
152 | {
153 | short hash = GetHashIndex(ch);
154 | for (var i = 0; i < PyHash.hashes[hash].Length; ++i)
155 | {
156 | short index = PyHash.hashes[hash][i];
157 | var pos = PyCode.codes[index].IndexOf(ch, 7);
158 | if (pos != -1)
159 | return PyCode.codes[index].Substring(0, 6).Trim();
160 | }
161 | return ch.ToString();
162 | }
163 |
164 | ///
165 | /// 返回单个字符的汉字拼音
166 | ///
167 | /// 编码为encoding的中文字符
168 | /// 编码为encoding的ch对应的拼音
169 | public static string GetPinyin(char ch, Encoding encoding)
170 | {
171 | ch = ConvertEncoding(ch.ToString(), encoding, Encoding.UTF8)[0];
172 | return ConvertEncoding(GetPinyin(ch), Encoding.UTF8, encoding);
173 | }
174 |
175 | ///
176 | /// 转换编码
177 | ///
178 | /// 文本
179 | /// 源编码
180 | /// 目标编码
181 | /// 目标编码文本
182 | public static string ConvertEncoding(string text, Encoding srcEncoding, Encoding dstEncoding)
183 | {
184 | byte[] srcBytes = srcEncoding.GetBytes(text);
185 | byte[] dstBytes = Encoding.Convert(srcEncoding, dstEncoding, srcBytes);
186 | return dstEncoding.GetString(dstBytes);
187 | }
188 |
189 | ///
190 | /// 取文本索引值
191 | ///
192 | /// 字符
193 | /// 文本索引值
194 | private static short GetHashIndex(char ch)
195 | {
196 | return (short)((uint)ch % PyCode.codes.Length);
197 | }
198 | }
199 | }
200 |
--------------------------------------------------------------------------------
/GenPg/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace GenPg
5 | {
6 | class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | if (args != null && args.Length == 0) args = new[] { "?" };
11 | ManualResetEvent wait = new ManualResetEvent(false);
12 | new Thread(() => {
13 | Thread.CurrentThread.Join(TimeSpan.FromSeconds(1));
14 | ConsoleApp app = new ConsoleApp(args, wait);
15 | }).Start();
16 | wait.WaitOne();
17 | return;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/GenPg/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "GenPg": {
4 | "commandName": "Project",
5 | "commandLineArgs": "103.253.41.44:54332 -U anzhong -P A1.3212OZ5P -D anzhong -N az -R -A -S -O \"d:\\123123\""
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/GenPg/WinFormClass/WorkQueue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading;
5 |
6 | public class WorkQueue : WorkQueue {
7 | public WorkQueue() : this(16, -1) { }
8 | public WorkQueue(int thread)
9 | : this(thread, -1) {
10 | }
11 | public WorkQueue(int thread, int capacity) {
12 | base.Thread = thread;
13 | base.Capacity = capacity;
14 | base.Process += delegate(AnonymousHandler ah) {
15 | ah();
16 | };
17 | }
18 | }
19 |
20 | public class WorkQueue : IDisposable {
21 | public delegate void WorkQueueProcessHandler(T item);
22 | public event WorkQueueProcessHandler Process;
23 |
24 | private int _thread = 16;
25 | private int _capacity = -1;
26 | private int _work_index = 0;
27 | private Dictionary _works = new Dictionary();
28 | private object _works_lock = new object();
29 | private Queue _queue = new Queue();
30 | private object _queue_lock = new object();
31 |
32 | public WorkQueue() : this(16, -1) { }
33 | public WorkQueue(int thread)
34 | : this(thread, -1) {
35 | }
36 | public WorkQueue(int thread, int capacity) {
37 | _thread = thread;
38 | _capacity = capacity;
39 | }
40 |
41 | public void Enqueue(T item) {
42 | lock (_queue_lock) {
43 | if (_capacity > 0 && _queue.Count >= _capacity) return;
44 | _queue.Enqueue(item);
45 | }
46 | lock (_works_lock) {
47 | foreach (WorkInfo w in _works.Values) {
48 | if (w.IsWaiting) {
49 | w.Set();
50 | return;
51 | }
52 | }
53 | }
54 | if (_works.Count < _thread) {
55 | if (_queue.Count > 0) {
56 | int index = 0;
57 | lock (_works_lock) {
58 | index = _work_index++;
59 | _works.Add(index, new WorkInfo());
60 | }
61 | new Thread(delegate() {
62 | WorkInfo work = _works[index];
63 | while (true) {
64 | List de = new List();
65 | if (_queue.Count > 0) {
66 | lock (_queue_lock) {
67 | if (_queue.Count > 0) {
68 | de.Add(_queue.Dequeue());
69 | }
70 | }
71 | }
72 |
73 | if (de.Count > 0) {
74 | try {
75 | this.OnProcess(de[0]);
76 | } catch {
77 | }
78 | }
79 |
80 | if (_queue.Count == 0) {
81 | work.WaitOne(TimeSpan.FromSeconds(20));
82 |
83 | if (_queue.Count == 0) {
84 | break;
85 | }
86 | }
87 | }
88 | lock (_works_lock) {
89 | _works.Remove(index);
90 | }
91 | work.Dispose();
92 | }).Start();
93 | }
94 | }
95 | }
96 |
97 | protected virtual void OnProcess(T item) {
98 | if (Process != null) {
99 | Process(item);
100 | }
101 | }
102 |
103 | #region IDisposable 成员
104 |
105 | public void Dispose() {
106 | lock (_queue_lock) {
107 | _queue.Clear();
108 | }
109 | lock (_works_lock) {
110 | foreach (WorkInfo w in _works.Values) {
111 | w.Dispose();
112 | }
113 | }
114 | }
115 |
116 | #endregion
117 |
118 | public int Thread {
119 | get { return _thread; }
120 | set {
121 | if (_thread != value) {
122 | _thread = value;
123 | }
124 | }
125 | }
126 | public int Capacity {
127 | get { return _capacity; }
128 | set {
129 | if (_capacity != value) {
130 | _capacity = value;
131 | }
132 | }
133 | }
134 |
135 | public int UsedThread {
136 | get { return _works.Count; }
137 | }
138 | public int Queue {
139 | get { return _queue.Count; }
140 | }
141 |
142 | public string Statistics {
143 | get {
144 | string value = string.Format(@"线程:{0}/{1}
145 | 队列:{2}
146 |
147 | ", _works.Count, _thread, _queue.Count);
148 | int[] keys = new int[_works.Count];
149 | try {
150 | _works.Keys.CopyTo(keys, 0);
151 | } catch {
152 | lock (_works_lock) {
153 | keys = new int[_works.Count];
154 | _works.Keys.CopyTo(keys, 0);
155 | }
156 | }
157 | foreach (int k in keys) {
158 | WorkInfo w = null;
159 | if (_works.TryGetValue(k, out w)) {
160 | value += string.Format(@"线程{0}:{1}
161 | ", k, w.IsWaiting);
162 | }
163 | }
164 | return value;
165 | }
166 | }
167 |
168 | class WorkInfo : IDisposable {
169 | private ManualResetEvent _reset = new ManualResetEvent(false);
170 | private bool _isWaiting = false;
171 |
172 | public void WaitOne(TimeSpan timeout) {
173 | try {
174 | _reset.Reset();
175 | _isWaiting = true;
176 | _reset.WaitOne(timeout);
177 | } catch { }
178 | }
179 | public void Set() {
180 | try {
181 | _isWaiting = false;
182 | _reset.Set();
183 | } catch { }
184 | }
185 |
186 | public bool IsWaiting {
187 | get { return _isWaiting; }
188 | }
189 |
190 | #region IDisposable 成员
191 |
192 | public void Dispose() {
193 | this.Set();
194 | }
195 |
196 | #endregion
197 | }
198 | }
--------------------------------------------------------------------------------
/GenPg/plist-cil/NSArray.IList.cs:
--------------------------------------------------------------------------------
1 | // plist-cil - An open source library to parse and generate property lists for .NET
2 | // Copyright (C) 2016 Quamotion
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | // SOFTWARE.
21 | using System;
22 | using System.Collections;
23 | using System.Collections.Generic;
24 | using System.Linq;
25 | using System.Text;
26 |
27 | namespace PList {
28 | partial class NSArray : IList {
29 | ///
30 | public NSObject this[int index] {
31 | get {
32 | return this.array[index];
33 | }
34 |
35 | set {
36 | this.array[index] = value;
37 | }
38 | }
39 |
40 | ///
41 | public bool IsReadOnly {
42 | get {
43 | return false;
44 | }
45 | }
46 |
47 | public void Add(object item) {
48 | this.Add(NSObject.Wrap(item));
49 | }
50 |
51 | ///
52 | public void Add(NSObject item) {
53 | this.array.Add(item);
54 | }
55 |
56 | ///
57 | public void Clear() {
58 | this.array.Clear();
59 | }
60 |
61 | public bool Contains(object item) {
62 | return this.Contains(NSObject.Wrap(item));
63 | }
64 |
65 | ///
66 | public bool Contains(NSObject item) {
67 | return this.array.Contains(item);
68 | }
69 |
70 | ///
71 | public void CopyTo(NSObject[] array, int arrayIndex) {
72 | this.array.CopyTo(array, arrayIndex);
73 | }
74 |
75 | ///
76 | public IEnumerator GetEnumerator() {
77 | return this.array.GetEnumerator();
78 | }
79 |
80 | public int IndexOf(object item) {
81 | return this.array.IndexOf(NSObject.Wrap(item));
82 | }
83 |
84 | ///
85 | public int IndexOf(NSObject item) {
86 | return this.array.IndexOf(item);
87 | }
88 |
89 | public void Insert(int index, object item) {
90 | this.Insert(index, NSObject.Wrap(item));
91 | }
92 |
93 | ///
94 | public void Insert(int index, NSObject item) {
95 | this.array.Insert(index, item);
96 | }
97 |
98 | public bool Remove(object item) {
99 | return this.Remove(NSObject.Wrap(item));
100 | }
101 |
102 | ///
103 | public bool Remove(NSObject item) {
104 | return this.array.Remove(item);
105 | }
106 |
107 | ///
108 | public void RemoveAt(int index) {
109 | this.array.RemoveAt(index);
110 | }
111 |
112 | ///
113 | IEnumerator IEnumerable.GetEnumerator() {
114 | return this.array.GetEnumerator();
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/GenPg/plist-cil/PropertyListException.cs:
--------------------------------------------------------------------------------
1 | // plist-cil - An open source library to parse and generate property lists for .NET
2 | // Copyright (C) 2015 Natalia Portillo
3 | // Copyright (C) 2016 Quamotion
4 | //
5 | // This code is based on:
6 | // plist - An open source library to parse and generate property lists
7 | // Copyright (C) 2014 Daniel Dreibrodt
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 | using System;
27 | using System.Runtime.Serialization;
28 |
29 | namespace PList {
30 | ///
31 | /// The exception that is thrown when an property list file could not be processed correctly.
32 | ///
33 | public class PropertyListException : Exception {
34 | ///
35 | /// Initializes a new instance of the class.
36 | ///
37 | public PropertyListException() {
38 | }
39 |
40 | ///
41 | /// Initializes a new instance of the class.
42 | ///
43 | ///
44 | /// The error message that explains the reason for the exception.
45 | ///
46 | public PropertyListException(string message)
47 | : base(message) {
48 | }
49 |
50 | ///
51 | /// Initializes a new instance of the class.
52 | ///
53 | ///
54 | /// The error message that explains the reason for the exception.
55 | ///
56 | ///
57 | /// The exception that is the cause of the current exception, or
58 | /// if no inner exception is specified.
59 | ///
60 | public PropertyListException(string message, Exception inner)
61 | : base(message, inner) {
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/GenPg/plist-cil/PropertyListFormatException.cs:
--------------------------------------------------------------------------------
1 | // plist-cil - An open source library to parse and generate property lists for .NET
2 | // Copyright (C) 2015 Natalia Portillo
3 | //
4 | // This code is based on:
5 | // plist - An open source library to parse and generate property lists
6 | // Copyright (C) 2014 Daniel Dreibrodt
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy
9 | // of this software and associated documentation files (the "Software"), to deal
10 | // in the Software without restriction, including without limitation the rights
11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | // copies of the Software, and to permit persons to whom the Software is
13 | // furnished to do so, subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in
16 | // all copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | // SOFTWARE.
25 | using System;
26 |
27 | namespace PList {
28 | ///
29 | /// A PropertyListFormatException is thrown by the various property list format parsers
30 | /// when an error in the format of the given property list is encountered.
31 | ///
32 | /// @author Daniel Dreibrodt
33 | /// @author Natalia Portillo
34 | public class PropertyListFormatException : PropertyListException {
35 | ///
36 | /// Creates a new exception with the given message.
37 | ///
38 | /// A message containing information about the nature of the exception.
39 | public PropertyListFormatException(string message) : base(message) {
40 | }
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/GenPg/plist-cil/UID.cs:
--------------------------------------------------------------------------------
1 | // plist-cil - An open source library to parse and generate property lists for .NET
2 | // Copyright (C) 2015 Natalia Portillo
3 | //
4 | // This code is based on:
5 | // plist - An open source library to parse and generate property lists
6 | // Copyright (C) 2014 Daniel Dreibrodt
7 | //
8 | // Permission is hereby granted, free of charge, to any person obtaining a copy
9 | // of this software and associated documentation files (the "Software"), to deal
10 | // in the Software without restriction, including without limitation the rights
11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | // copies of the Software, and to permit persons to whom the Software is
13 | // furnished to do so, subject to the following conditions:
14 | //
15 | // The above copyright notice and this permission notice shall be included in
16 | // all copies or substantial portions of the Software.
17 | //
18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 | // SOFTWARE.
25 | using System;
26 | using System.Text;
27 |
28 | namespace PList {
29 | ///
30 | /// An UID. Only found in binary property lists that are keyed archives.
31 | ///
32 | /// @author Daniel Dreibrodt
33 | /// @author Natalia Portillo
34 | public class UID : NSObject {
35 | readonly byte[] bytes;
36 | readonly string name;
37 |
38 | ///
39 | /// Initializes a new instance of the class.
40 | ///
41 | /// Name.
42 | /// Bytes.
43 | public UID(String name, byte[] bytes) {
44 | this.name = name;
45 | this.bytes = bytes;
46 | }
47 |
48 | ///
49 | /// Gets the bytes.
50 | ///
51 | /// The bytes.
52 | public byte[] Bytes {
53 | get {
54 | return bytes;
55 | }
56 | }
57 |
58 | ///
59 | /// Gets the name.
60 | ///
61 | /// The name.
62 | public string Name {
63 | get {
64 | return name;
65 | }
66 | }
67 |
68 | ///
69 | /// There is no XML representation specified for UIDs.
70 | /// In this implementation UIDs are represented as strings in the XML output.
71 | ///
72 | /// The xml StringBuilder
73 | /// The indentation level
74 | internal override void ToXml(StringBuilder xml, int level) {
75 | Indent(xml, level);
76 | xml.Append("");
77 | foreach (byte b in bytes)
78 | xml.Append(String.Format("{0:x2}", b));
79 | xml.Append("");
80 | }
81 |
82 | internal override void ToBinary(BinaryPropertyListWriter outPlist) {
83 | outPlist.Write(0x80 + bytes.Length - 1);
84 | outPlist.Write(bytes);
85 | }
86 |
87 | internal override void ToASCII(StringBuilder ascii, int level) {
88 | Indent(ascii, level);
89 | ascii.Append("\"");
90 | foreach (byte b in bytes)
91 | ascii.Append(String.Format("{0:x2}", b));
92 | ascii.Append("\"");
93 | }
94 |
95 | internal override void ToASCIIGnuStep(StringBuilder ascii, int level) {
96 | ToASCII(ascii, level);
97 | }
98 |
99 | ///
100 | /// Determines whether the specified is equal to the current .
101 | ///
102 | /// The to compare with the current .
103 | /// true if the specified is equal to the current
104 | /// ; otherwise, false.
105 | public override bool Equals(NSObject obj) {
106 | if (!(obj is UID))
107 | return false;
108 |
109 | if (((UID)obj).Name != name)
110 | return false;
111 |
112 | return ArrayEquals(((UID)obj).Bytes, bytes);
113 | }
114 | }
115 | }
116 |
117 |
--------------------------------------------------------------------------------
/MakeCode/FrmMain.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/MakeCode/FrmMain.cs
--------------------------------------------------------------------------------
/MakeCode/FrmView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Drawing;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace MakeCode {
11 | public partial class FrmView : Form {
12 | public FrmView() {
13 | InitializeComponent();
14 | }
15 |
16 | private void btnOk_Click(object sender, EventArgs e) {
17 | this.Close();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MakeCode/FrmView.designer.cs:
--------------------------------------------------------------------------------
1 | namespace MakeCode {
2 | partial class FrmView {
3 | ///
4 | /// 必需的设计器变量。
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// 清理所有正在使用的资源。
10 | ///
11 | /// 如果应释放托管资源,为 true;否则为 false。
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region Windows 窗体设计器生成的代码
20 |
21 | ///
22 | /// 设计器支持所需的方法 - 不要
23 | /// 使用代码编辑器修改此方法的内容。
24 | ///
25 | private void InitializeComponent() {
26 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
27 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
28 | this.btnOk = new System.Windows.Forms.Button();
29 | this.dgvGridview = new System.Windows.Forms.DataGridView();
30 | this.dgvColIcon = new System.Windows.Forms.DataGridViewImageColumn();
31 | this.dgvColName = new System.Windows.Forms.DataGridViewTextBoxColumn();
32 | this.dgvColDBType = new System.Windows.Forms.DataGridViewTextBoxColumn();
33 | this.dgvColAllowDBNull = new System.Windows.Forms.DataGridViewCheckBoxColumn();
34 | this.dgvColView = new System.Windows.Forms.DataGridViewLinkColumn();
35 | ((System.ComponentModel.ISupportInitialize)(this.dgvGridview)).BeginInit();
36 | this.SuspendLayout();
37 | //
38 | // btnOk
39 | //
40 | this.btnOk.DialogResult = System.Windows.Forms.DialogResult.Cancel;
41 | this.btnOk.Location = new System.Drawing.Point(262, 372);
42 | this.btnOk.Name = "btnOk";
43 | this.btnOk.Size = new System.Drawing.Size(62, 21);
44 | this.btnOk.TabIndex = 1;
45 | this.btnOk.Text = "Ok";
46 | this.btnOk.UseVisualStyleBackColor = true;
47 | this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
48 | //
49 | // dgvGridview
50 | //
51 | this.dgvGridview.AllowUserToAddRows = false;
52 | this.dgvGridview.AllowUserToResizeRows = false;
53 | this.dgvGridview.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
54 | this.dgvGridview.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
55 | this.dgvGridview.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
56 | this.dgvColIcon,
57 | this.dgvColName,
58 | this.dgvColDBType,
59 | this.dgvColAllowDBNull,
60 | this.dgvColView});
61 | this.dgvGridview.Location = new System.Drawing.Point(12, 12);
62 | this.dgvGridview.Name = "dgvGridview";
63 | this.dgvGridview.ReadOnly = true;
64 | this.dgvGridview.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
65 | this.dgvGridview.RowTemplate.Height = 23;
66 | this.dgvGridview.Size = new System.Drawing.Size(562, 352);
67 | this.dgvGridview.TabIndex = 0;
68 | //
69 | // dgvColIcon
70 | //
71 | this.dgvColIcon.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
72 | dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
73 | dataGridViewCellStyle17.NullValue = null;
74 | dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.White;
75 | this.dgvColIcon.DefaultCellStyle = dataGridViewCellStyle17;
76 | this.dgvColIcon.HeaderText = " ";
77 | this.dgvColIcon.Name = "dgvColIcon";
78 | this.dgvColIcon.ReadOnly = true;
79 | this.dgvColIcon.Width = 21;
80 | //
81 | // dgvColName
82 | //
83 | this.dgvColName.HeaderText = "Name";
84 | this.dgvColName.Name = "dgvColName";
85 | this.dgvColName.ReadOnly = true;
86 | this.dgvColName.Width = 210;
87 | //
88 | // dgvColDBType
89 | //
90 | this.dgvColDBType.HeaderText = "SqlType";
91 | this.dgvColDBType.Name = "dgvColDBType";
92 | this.dgvColDBType.ReadOnly = true;
93 | this.dgvColDBType.Width = 130;
94 | //
95 | // dgvColAllowDBNull
96 | //
97 | this.dgvColAllowDBNull.HeaderText = "AllowDBNull";
98 | this.dgvColAllowDBNull.Name = "dgvColAllowDBNull";
99 | this.dgvColAllowDBNull.ReadOnly = true;
100 | this.dgvColAllowDBNull.Resizable = System.Windows.Forms.DataGridViewTriState.True;
101 | this.dgvColAllowDBNull.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
102 | this.dgvColAllowDBNull.Width = 80;
103 | //
104 | // dgvColView
105 | //
106 | dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
107 | dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.White;
108 | this.dgvColView.DefaultCellStyle = dataGridViewCellStyle18;
109 | this.dgvColView.HeaderText = "Relation";
110 | this.dgvColView.Name = "dgvColView";
111 | this.dgvColView.ReadOnly = true;
112 | this.dgvColView.Resizable = System.Windows.Forms.DataGridViewTriState.True;
113 | this.dgvColView.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
114 | this.dgvColView.Text = "View";
115 | this.dgvColView.Width = 60;
116 | //
117 | // FrmView
118 | //
119 | this.AcceptButton = this.btnOk;
120 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
121 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
122 | this.BackColor = System.Drawing.Color.BlanchedAlmond;
123 | this.CancelButton = this.btnOk;
124 | this.ClientSize = new System.Drawing.Size(586, 405);
125 | this.Controls.Add(this.dgvGridview);
126 | this.Controls.Add(this.btnOk);
127 | this.ForeColor = System.Drawing.Color.Black;
128 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
129 | this.MaximizeBox = false;
130 | this.Name = "FrmView";
131 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
132 | ((System.ComponentModel.ISupportInitialize)(this.dgvGridview)).EndInit();
133 | this.ResumeLayout(false);
134 |
135 | }
136 |
137 | #endregion
138 |
139 | private System.Windows.Forms.Button btnOk;
140 | public System.Windows.Forms.DataGridView dgvGridview;
141 | private System.Windows.Forms.DataGridViewImageColumn dgvColIcon;
142 | private System.Windows.Forms.DataGridViewTextBoxColumn dgvColName;
143 | private System.Windows.Forms.DataGridViewTextBoxColumn dgvColDBType;
144 | private System.Windows.Forms.DataGridViewCheckBoxColumn dgvColAllowDBNull;
145 | private System.Windows.Forms.DataGridViewLinkColumn dgvColView;
146 | }
147 | }
--------------------------------------------------------------------------------
/MakeCode/FrmView.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MakeCode/Lib.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Windows.Forms;
4 |
5 | namespace MakeCode {
6 | public static class Lib {
7 |
8 | public static void Msgbox(string text) {
9 | Msgbox(text, MessageBoxIcon.Information);
10 | }
11 | public static void Msgbox(string text, MessageBoxIcon icon) {
12 | MessageBox.Show(text, Application.ProductName + " " + Application.ProductVersion, MessageBoxButtons.OK, icon);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MakeCode/MakeCode.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {5FDB8603-9878-49E3-9570-04734FDF1FDE}
9 | Exe
10 | Properties
11 | MakeCode
12 | MakeCode
13 | v2.0
14 |
15 |
16 |
17 |
18 | 2.0
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 |
40 |
41 |
42 | False
43 | ..\Mono.Security.dll
44 |
45 |
46 | False
47 | ..\Npgsql.dll
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | Form
61 |
62 |
63 | FrmMain.cs
64 |
65 |
66 | Form
67 |
68 |
69 | FrmView.cs
70 |
71 |
72 |
73 |
74 |
75 | FrmMain.cs
76 | Designer
77 |
78 |
79 | FrmView.cs
80 | Designer
81 |
82 |
83 | ResXFileCodeGenerator
84 | Resources.Designer.cs
85 | Designer
86 |
87 |
88 | True
89 | Resources.resx
90 | True
91 |
92 |
93 |
94 | SettingsSingleFileGenerator
95 | Settings.Designer.cs
96 |
97 |
98 |
99 | SettingsSingleFileGenerator
100 | Settings.Designer.cs
101 |
102 |
103 | True
104 | Settings.settings
105 | True
106 |
107 |
108 | True
109 | True
110 | Settings.settings
111 |
112 |
113 |
114 |
115 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}
116 | Common
117 |
118 |
119 |
120 |
127 |
--------------------------------------------------------------------------------
/MakeCode/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 | using Model;
5 | using System.Threading;
6 |
7 | namespace MakeCode {
8 | static class Program {
9 | ///
10 | /// 应用程序的主入口点。
11 | ///
12 | [STAThread]
13 | static void Main(params string[] args) {
14 | if (args != null && args.Length > 0) {
15 | ManualResetEvent wait = new ManualResetEvent(false);
16 | new Thread(() => {
17 | Thread.CurrentThread.Join(TimeSpan.FromSeconds(1));
18 | ConsoleApp app = new ConsoleApp(args, wait);
19 | }).Start();
20 | wait.WaitOne();
21 | return;
22 | }
23 | Application.EnableVisualStyles();
24 | Application.SetCompatibleTextRenderingDefault(false);
25 | Application.Run(new FrmMain());
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/MakeCode/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("NicPetShop")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("NicPetShop")]
13 | [assembly: AssemblyCopyright("版权所有 (C) 2008")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("d26d6e70-6297-4f9c-992d-02c5478ca63b")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/MakeCode/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MakeCode.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MakeCode.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/MakeCode/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/MakeCode/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MakeCode.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string txtServer_text {
30 | get {
31 | return ((string)(this["txtServer_text"]));
32 | }
33 | set {
34 | this["txtServer_text"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("")]
41 | public string txtUsername_text {
42 | get {
43 | return ((string)(this["txtUsername_text"]));
44 | }
45 | set {
46 | this["txtUsername_text"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("")]
53 | public string txtPassword_text {
54 | get {
55 | return ((string)(this["txtPassword_text"]));
56 | }
57 | set {
58 | this["txtPassword_text"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("")]
65 | public string txtSolution_text {
66 | get {
67 | return ((string)(this["txtSolution_text"]));
68 | }
69 | set {
70 | this["txtSolution_text"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
77 | public bool chkSolution_checked {
78 | get {
79 | return ((bool)(this["chkSolution_checked"]));
80 | }
81 | set {
82 | this["chkSolution_checked"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
89 | public bool chkIntegrated_Checked {
90 | get {
91 | return ((bool)(this["chkIntegrated_Checked"]));
92 | }
93 | set {
94 | this["chkIntegrated_Checked"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
101 | public bool chkMultiDB_checked {
102 | get {
103 | return ((bool)(this["chkMultiDB_checked"]));
104 | }
105 | set {
106 | this["chkMultiDB_checked"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
113 | public bool chkWebAdmin_checked {
114 | get {
115 | return ((bool)(this["chkWebAdmin_checked"]));
116 | }
117 | set {
118 | this["chkWebAdmin_checked"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
125 | public bool chkDownloadRes_checked {
126 | get {
127 | return ((bool)(this["chkDownloadRes_checked"]));
128 | }
129 | set {
130 | this["chkDownloadRes_checked"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("5432")]
137 | public string txtPort_text {
138 | get {
139 | return ((string)(this["txtPort_text"]));
140 | }
141 | set {
142 | this["txtPort_text"] = value;
143 | }
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/MakeCode/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | False
19 |
20 |
21 | True
22 |
23 |
24 | False
25 |
26 |
27 | False
28 |
29 |
30 | False
31 |
32 |
33 | 5432
34 |
35 |
36 |
--------------------------------------------------------------------------------
/MakeCode/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MakeCode {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("127.0.0.1:38888")]
29 | public string server {
30 | get {
31 | return ((string)(this["server"]));
32 | }
33 | set {
34 | this["server"] = value;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/MakeCode/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 127.0.0.1:38888
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MakeCode/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | 127.0.0.1:38888
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | False
30 |
31 |
32 | True
33 |
34 |
35 | False
36 |
37 |
38 | False
39 |
40 |
41 | False
42 |
43 |
44 | 5432
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Mono.Security.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Mono.Security.dll
--------------------------------------------------------------------------------
/Npgsql.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Npgsql.dll
--------------------------------------------------------------------------------
/Server/CodeBuild(DB).cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/CodeBuild(DB).cs
--------------------------------------------------------------------------------
/Server/Logger.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/Logger.cs
--------------------------------------------------------------------------------
/Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Server")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Server")]
13 | [assembly: AssemblyCopyright("版权所有 (C) 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("1963fe13-0957-46b8-b20c-593eb34a5897")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Server/Protocol.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/Protocol.cs
--------------------------------------------------------------------------------
/Server/Resources/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/Server/Resources/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | [Xx]64/
19 | [Xx]86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 |
24 | # Visual Studio 2015 cache/options directory
25 | .vs/
26 | # Uncomment if you have tasks that create the project's static files in wwwroot
27 | #wwwroot/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | # NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | # DNX
43 | project.lock.json
44 | package-lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 | *.sap
90 |
91 | # TFS 2012 Local Workspace
92 | $tf/
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 | *.DotSettings.user
101 |
102 | # JustCode is a .NET coding add-in
103 | .JustCode
104 |
105 | # TeamCity is a build add-in
106 | _TeamCity*
107 |
108 | # DotCover is a Code Coverage Tool
109 | *.dotCover
110 |
111 | # NCrunch
112 | _NCrunch_*
113 | .*crunch*.local.xml
114 | nCrunchTemp_*
115 |
116 | # MightyMoose
117 | *.mm.*
118 | AutoTest.Net/
119 |
120 | # Web workbench (sass)
121 | .sass-cache/
122 |
123 | # Installshield output folder
124 | [Ee]xpress/
125 |
126 | # DocProject is a documentation generator add-in
127 | DocProject/buildhelp/
128 | DocProject/Help/*.HxT
129 | DocProject/Help/*.HxC
130 | DocProject/Help/*.hhc
131 | DocProject/Help/*.hhk
132 | DocProject/Help/*.hhp
133 | DocProject/Help/Html2
134 | DocProject/Help/html
135 |
136 | # Click-Once directory
137 | publish/
138 |
139 | # Publish Web Output
140 | *.[Pp]ublish.xml
141 | *.azurePubxml
142 |
143 | # TODO: Un-comment the next line if you do not want to checkin
144 | # your web deploy settings because they may include unencrypted
145 | # passwords
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # NuGet Packages
150 | *.nupkg
151 | # The packages folder can be ignored because of Package Restore
152 | **/packages/*
153 | # except build/, which is used as an MSBuild target.
154 | !**/packages/build/
155 | # Uncomment if necessary however generally it will be regenerated when needed
156 | #!**/packages/repositories.config
157 | # NuGet v3's project.json files produces more ignoreable files
158 | *.nuget.props
159 | *.nuget.targets
160 |
161 | # Microsoft Azure Build Output
162 | csx/
163 | *.build.csdef
164 |
165 | # Microsoft Azure Emulator
166 | ecf/
167 | rcf/
168 |
169 | # Microsoft Azure ApplicationInsights config file
170 | ApplicationInsights.config
171 |
172 | # Windows Store app package directory
173 | AppPackages/
174 | BundleArtifacts/
175 |
176 | # Visual Studio cache files
177 | # files ending in .cache can be ignored
178 | *.[Cc]ache
179 | # but keep track of directories ending in .cache
180 | !*.[Cc]ache/
181 |
182 | # Others
183 | ClientBin/
184 | [Ss]tyle[Cc]op.*
185 | ~$*
186 | *~
187 | *.dbmdl
188 | *.dbproj.schemaview
189 | *.pfx
190 | *.publishsettings
191 | node_modules/
192 | orleans.codegen.cs
193 |
194 | # RIA/Silverlight projects
195 | Generated_Code/
196 |
197 | # Backup & report files from converting an old project file
198 | # to a newer Visual Studio version. Backup files are not needed,
199 | # because we have git ;-)
200 | _UpgradeReport_Files/
201 | Backup*/
202 | UpgradeLog*.XML
203 | UpgradeLog*.htm
204 |
205 | # SQL Server files
206 | *.mdf
207 | *.ldf
208 |
209 | # Business Intelligence projects
210 | *.rdl.data
211 | *.bim.layout
212 | *.bim_*.settings
213 |
214 | # Microsoft Fakes
215 | FakesAssemblies/
216 |
217 | # GhostDoc plugin setting file
218 | *.GhostDoc.xml
219 |
220 | # Node.js Tools for Visual Studio
221 | .ntvs_analysis.dat
222 |
223 | # Visual Studio 6 build log
224 | *.plg
225 |
226 | # Visual Studio 6 workspace options file
227 | *.opt
228 |
229 | # Visual Studio LightSwitch build output
230 | **/*.HTMLClient/GeneratedArtifacts
231 | **/*.DesktopClient/GeneratedArtifacts
232 | **/*.DesktopClient/ModelManifest.xml
233 | **/*.Server/GeneratedArtifacts
234 | **/*.Server/ModelManifest.xml
235 | _Pvt_Extensions
236 |
237 | # LightSwitch generated files
238 | GeneratedArtifacts/
239 | ModelManifest.xml
240 |
241 | # Paket dependency manager
242 | .paket/paket.exe
243 |
244 | # FAKE - F# Make
245 | .fake/
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/Controllers/BaseController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Cors;
2 | using Microsoft.AspNetCore.Http;
3 | using Microsoft.AspNetCore.Mvc;
4 | using Microsoft.AspNetCore.Mvc.Filters;
5 | using Microsoft.Extensions.Configuration;
6 | using Microsoft.Extensions.Logging;
7 | using Newtonsoft.Json;
8 | using System;
9 | using System.Collections;
10 | using System.Linq;
11 | using System.Threading.Tasks;
12 |
13 | [ServiceFilter(typeof(CustomExceptionFilter)), EnableCors("cors_all")]
14 | public partial class BaseController : Controller {
15 | public ILogger _logger;
16 | public ISession Session { get { return HttpContext.Session; } }
17 | public HttpRequest Req { get { return Request; } }
18 | public HttpResponse Res { get { return Response; } }
19 |
20 | public string Ip => this.Request.Headers["X-Real-IP"].FirstOrDefault() ?? this.Request.HttpContext.Connection.RemoteIpAddress.ToString();
21 | public IConfiguration Configuration => (IConfiguration) HttpContext.RequestServices.GetService(typeof(IConfiguration));
22 | //public SysuserInfo LoginUser { get; private set; }
23 | public BaseController(ILogger logger) { _logger = logger; }
24 | public override void OnActionExecuting(ActionExecutingContext context) {
25 | #region 参数验证
26 | if (context.ModelState.IsValid == false)
27 | foreach (var value in context.ModelState.Values)
28 | if (value.Errors.Any()) {
29 | context.Result = APIReturn.参数格式不正确.SetMessage($"参数格式不正确:{value.Errors.First().ErrorMessage}");
30 | return;
31 | }
32 | #endregion
33 | #region 初始化当前登陆账号
34 | //string username = Session.GetString("login.username");
35 | //if (!string.IsNullOrEmpty(username)) LoginUser = Sysuser.GetItemByUsername(username);
36 |
37 | //var method = (context.ActionDescriptor as ControllerActionDescriptor).MethodInfo;
38 | //if (method.GetCustomAttribute<需要登陆Attribute>() != null && LoginUser == null)
39 | // context.Result = new RedirectResult("/signin");
40 | //else if (method.GetCustomAttribute<匿名访问Attribute>() == null && LoginUser == null)
41 | // context.Result = new RedirectResult("/signin");
42 | //ViewBag.user = LoginUser;
43 | #endregion
44 | base.OnActionExecuting(context);
45 | }
46 | public override void OnActionExecuted(ActionExecutedContext context) {
47 | base.OnActionExecuted(context);
48 | }
49 |
50 | #region 角色权限验证
51 | //public bool sysrole_check(string url) {
52 | // url = url.ToLower();
53 | // //Response.Write(url + " ");
54 | // if (url == "/" || url.IndexOf("/default.aspx") == 0) return true;
55 | // foreach(var role in this.LoginUser.Obj_sysroles) {
56 | // //Response.Write(role.ToString());
57 | // foreach(var dir in role.Obj_sysdirs) {
58 | // //Response.Write("-----------------" + dir.ToString() + " ");
59 | // string tmp = dir.Url;
60 | // if (tmp.EndsWith("/")) tmp += "default.aspx";
61 | // if (url.IndexOf(tmp) == 0) return true;
62 | // }
63 | // }
64 | // return false;
65 | //}
66 | #endregion
67 | }
68 |
69 | #region 需要登陆、匿名访问
70 | public partial class 需要登陆Attribute : Attribute { }
71 | public partial class 匿名访问Attribute : Attribute { }
72 | #endregion
73 |
74 | #region APIReturn
75 | [JsonObject(MemberSerialization.OptIn)]
76 | public partial class APIReturn : ContentResult {
77 | [JsonProperty("code")] public int Code { get; protected set; }
78 | [JsonProperty("message")] public string Message { get; protected set; }
79 | [JsonProperty("data")] public Hashtable Data { get; protected set; } = new Hashtable();
80 | [JsonProperty("success")] public bool Success { get { return this.Code == 0; } }
81 |
82 | public APIReturn() { }
83 | public APIReturn(int code) { this.SetCode(code); }
84 | public APIReturn(string message) { this.SetMessage(message); }
85 | public APIReturn(int code, string message, params object[] data) { this.SetCode(code).SetMessage(message).AppendData(data); }
86 |
87 | public APIReturn SetCode(int value) { this.Code = value; return this; }
88 | public APIReturn SetMessage(string value) { this.Message = value; return this; }
89 | public APIReturn SetData(params object[] value) {
90 | this.Data.Clear();
91 | return this.AppendData(value);
92 | }
93 | public APIReturn AppendData(params object[] value) {
94 | if (value == null || value.Length < 2 || value[0] == null) return this;
95 | for (int a = 0; a < value.Length; a += 2) {
96 | if (value[a] == null) continue;
97 | this.Data[value[a]] = a + 1 < value.Length ? value[a + 1] : null;
98 | }
99 | return this;
100 | }
101 | #region form 表单 target=iframe 提交回调处理
102 | private void Jsonp(ActionContext context) {
103 | string __callback = context.HttpContext.Request.HasFormContentType ? context.HttpContext.Request.Form["__callback"].ToString() : null;
104 | if (string.IsNullOrEmpty(__callback)) {
105 | this.ContentType = "text/json;charset=utf-8;";
106 | this.Content = JsonConvert.SerializeObject(this);
107 | }else {
108 | this.ContentType = "text/html;charset=utf-8";
109 | this.Content = $"";
110 | }
111 | }
112 | public override void ExecuteResult(ActionContext context) {
113 | Jsonp(context);
114 | base.ExecuteResult(context);
115 | }
116 | public override Task ExecuteResultAsync(ActionContext context) {
117 | Jsonp(context);
118 | return base.ExecuteResultAsync(context);
119 | }
120 | #endregion
121 |
122 | public static APIReturn 成功 { get { return new APIReturn(0, "成功"); } }
123 | public static APIReturn 失败 { get { return new APIReturn(99, "失败"); } }
124 | public static APIReturn 记录不存在_或者没有权限 { get { return new APIReturn(98, "记录不存在,或者没有权限"); } }
125 | public static APIReturn 参数格式不正确 { get { return new APIReturn(97, "参数格式不正确"); } }
126 | }
127 | #endregion
128 |
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/Controllers/CustomExceptionFilter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Hosting;
2 | using Microsoft.AspNetCore.Http;
3 | using Microsoft.AspNetCore.Mvc;
4 | using Microsoft.AspNetCore.Mvc.Filters;
5 | using Microsoft.Extensions.Configuration;
6 | using Microsoft.Extensions.Logging;
7 | using System;
8 | using System.Collections.Generic;
9 | using System.Security.Cryptography;
10 | using System.Text;
11 | using System.Threading.Tasks;
12 |
13 | public class CustomExceptionFilter : Attribute, IExceptionFilter {
14 | private ILogger _logger = null;
15 | private IConfiguration _cfg = null;
16 | private IHostingEnvironment _env = null;
17 |
18 | public CustomExceptionFilter (ILogger logger, IConfiguration cfg, IHostingEnvironment env) {
19 | _logger = logger;
20 | _cfg = cfg;
21 | _env = env;
22 | }
23 |
24 | public void OnException(ExceptionContext context) {
25 | //在这里记录错误日志,context.Exception 为异常对象
26 | context.Result = APIReturn.失败.SetMessage(context.Exception.Message); //返回给调用方
27 | var innerLog = context.Exception.InnerException != null ? $" \r\n{context.Exception.InnerException.Message} \r\n{ context.Exception.InnerException.StackTrace}" : "";
28 | _logger.LogError($"=============错误:{context.Exception.Message} \r\n{context.Exception.StackTrace}{innerLog}");
29 | context.ExceptionHandled = true;
30 | }
31 | }
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/Extensions/GlobalExtensions.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Text.RegularExpressions;
4 |
5 | public static class GlobalExtensions {
6 | public static object Json(this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper html, object obj) {
7 | string str = JsonConvert.SerializeObject(obj);
8 | if (!string.IsNullOrEmpty(str)) str = Regex.Replace(str, @"<(/?script[\s>])", "<\"+\"$1", RegexOptions.IgnoreCase);
9 | if (html == null) return str;
10 | return html.Raw(str);
11 | }
12 |
13 | ///
14 | /// 转格林时间,并以ISO8601格式化字符串
15 | ///
16 | ///
17 | ///
18 | public static string ToGmtISO8601(this DateTime time) {
19 | return time.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ");
20 | }
21 |
22 | ///
23 | /// 获取时间戳,按1970-1-1
24 | ///
25 | ///
26 | ///
27 | public static long GetTime(this DateTime time) {
28 | return (long)time.ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
29 | }
30 |
31 | static DateTime dt19700101 = new DateTime(1970, 1, 1);
32 | ///
33 | /// 获取时间戳毫秒数,按1970-1-1
34 | ///
35 | ///
36 | ///
37 | public static long GetTimeMilliseconds(this DateTime time) {
38 | return (long)time.ToUniversalTime().Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/ModuleBasic/IModuleInitializer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Builder;
2 | using Microsoft.AspNetCore.Hosting;
3 | using Microsoft.Extensions.DependencyInjection;
4 | using Microsoft.Extensions.Logging;
5 |
6 | public interface IModuleInitializer {
7 | void ConfigureServices(IServiceCollection services, IHostingEnvironment env);
8 | void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IApplicationLifetime lifetime);
9 | }
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/ModuleBasic/ModuleInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Reflection;
3 |
4 | public class ModuleInfo {
5 | public string Name { get; set; }
6 |
7 | public Assembly Assembly { get; set; }
8 | public IModuleInitializer Initializer { get; set; }
9 |
10 | public string ShortName {
11 | get {
12 | return Name.Split('.').Last();
13 | }
14 | }
15 |
16 | public string Path { get; set; }
17 | }
--------------------------------------------------------------------------------
/Server/Resources/Infrastructure/ModuleBasic/ModuleViewLocationExpander.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc.Razor;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | public class ModuleViewLocationExpander : IViewLocationExpander {
6 | private const string _moduleKey = "module";
7 |
8 | public IEnumerable ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable viewLocations) {
9 | if (context.Values.ContainsKey(_moduleKey)) {
10 | var module = context.Values[_moduleKey];
11 | if (!string.IsNullOrWhiteSpace(module)) {
12 | var moduleViewLocations = new string[] {
13 | "/Module/" + module + "/Views/{1}/{0}.cshtml",
14 | "/Module/" + module + "/Views/Shared/{0}.cshtml"
15 | };
16 | viewLocations = moduleViewLocations.Concat(viewLocations);
17 | }
18 | }
19 | return viewLocations;
20 | }
21 |
22 | public void PopulateValues(ViewLocationExpanderContext context) {
23 | var controller = context.ActionContext.ActionDescriptor.DisplayName;
24 | var moduleName = controller.Split('(')[1].Split(')')[0];
25 | context.Values[_moduleKey] = moduleName;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Server/Resources/WebHost/.gitignore:
--------------------------------------------------------------------------------
1 | [Mm]odule/
2 | wwwroot/[Mm]odule/
--------------------------------------------------------------------------------
/Server/Resources/WebHost/gulpfile.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var gulp = require('gulp'),
4 | clean = require('gulp-clean'),
5 | glob = require("glob");
6 |
7 | var paths = {
8 | devModule: "../Module/",
9 | hostModule: "./Module/",
10 | hostWwwrootModules: "./wwwroot/module/"
11 | };
12 |
13 | var modules = loadModules();
14 |
15 | gulp.task('clean-module', function () {
16 | return gulp.src([paths.hostModule + '*', paths.hostWwwrootModules + '*'], { read: false })
17 | .pipe(clean());
18 | });
19 |
20 | gulp.task('copy-module', ['clean-module'], function () {
21 | modules.forEach(function (module) {
22 | console.log(paths.devModule + module.fullName + '/Views/**/*.*');
23 | gulp.src([paths.devModule + module.fullName + '/Views/**/*.*'], { base: module.fullName })
24 | .pipe(gulp.dest(paths.hostModule + module.fullName));
25 | gulp.src(paths.devModule + module.fullName + '/bin/Debug/netstandard2.0/**/' + module.fullName + '.*')
26 | .pipe(gulp.dest(paths.hostModule + module.fullName));
27 | gulp.src(paths.devModule + module.fullName + '/appsettings.json')
28 | .pipe(gulp.dest(paths.hostModule + module.fullName));
29 | gulp.src(paths.devModule + module.fullName + '/wwwroot/**/*.*')
30 | .pipe(gulp.dest(paths.hostWwwrootModules + module.name));
31 | });
32 | });
33 |
34 | gulp.task('copy-static', function () {
35 | modules.forEach(function (module) {
36 | gulp.src([paths.devModule + module.fullName + '/Views/**/*.*'], { base: module.fullName })
37 | .pipe(gulp.dest(paths.hostModule + module.fullName));
38 | gulp.src(paths.devModule + module.fullName + '/wwwroot/**/*.*')
39 | .pipe(gulp.dest(paths.hostWwwrootModules + module.name));
40 | });
41 | });
42 |
43 | function loadModules() {
44 | var moduleManifestPaths,
45 | modules = [];
46 |
47 | moduleManifestPaths = glob.sync(paths.devModule + '*/*.csproj', {});
48 | moduleManifestPaths.forEach(function (moduleManifestPath) {
49 | var reg = /\/([^\/]+)\/\1\.csproj/.exec(moduleManifestPath);
50 | var moduleManifest = {
51 | name: reg[1],
52 | fullName: reg[1],
53 | version: "1.0.0"
54 | }
55 |
56 | //var exec = require('child_process').exec;
57 | //var child = exec('echo hello ' + name, function (err, stdout, stderr) {
58 | // if (err) throw err;
59 | // console.log(stdout);
60 | //});
61 |
62 | modules.push(moduleManifest);
63 | });
64 |
65 | return modules;
66 | }
--------------------------------------------------------------------------------
/Server/Resources/WebHost/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0",
3 | "name": "aaa",
4 | "private": true,
5 | "devDependencies": {
6 | "gulp": "3.9.1",
7 | "gulp-clean": "0.3.2",
8 | "glob": "7.1.1"
9 | }
10 | }
--------------------------------------------------------------------------------
/Server/Resources/WebHost/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Server/Resources/build.bat:
--------------------------------------------------------------------------------
1 |
2 | rem dotnet restore
3 |
4 | rem cd src/Module/Admin && dotnet build && cd ../../../
5 | rem cd src/Module/Order && dotnet build && cd ../../../
6 | rem cd src/Module/Search && dotnet build && cd ../../../
7 |
8 | dotnet build
9 |
10 | rem cd src/WebHost && npm install && npm install --global gulp-cli && gulp copy-module
11 | cd src/WebHost && gulp copy-module && cd ../../
12 |
13 | echo "Then type 'dotnet run' in src/WebHost to start the app."
14 |
15 | pause
--------------------------------------------------------------------------------
/Server/Resources/htm.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/Resources/htm.zip
--------------------------------------------------------------------------------
/Server/Server.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}
9 | Library
10 | Properties
11 | Server
12 | Server
13 | v2.0
14 |
15 |
16 |
17 |
18 | 2.0
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 | False
40 | ..\log4net.dll
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | True
55 | True
56 | Resources.resx
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}
68 | Common
69 |
70 |
71 |
72 |
73 | ResXFileCodeGenerator
74 | Designer
75 | Resources.Designer.cs
76 |
77 |
78 |
79 |
86 |
--------------------------------------------------------------------------------
/Server/ServerSocket.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/ServerSocket.cs
--------------------------------------------------------------------------------
/Server/log4net.config:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/Server/log4net.config
--------------------------------------------------------------------------------
/Server/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ServerWinForm/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ServerWinForm
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.SuspendLayout();
32 | //
33 | // Form1
34 | //
35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
37 | this.ClientSize = new System.Drawing.Size(533, 330);
38 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
39 | this.Name = "Form1";
40 | this.Text = "Form1";
41 | this.Load += new System.EventHandler(this.Form1_Load);
42 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
43 | this.ResumeLayout(false);
44 |
45 | }
46 |
47 | #endregion
48 | }
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/ServerWinForm/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace ServerWinForm
10 | {
11 | public partial class Form1 : Form
12 | {
13 | public Form1()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | Server.Protocol _prol;
19 | private void Form1_Load(object sender, EventArgs e)
20 | {
21 | Deflate.cs_head = Settings.Default.cs_head;
22 | _prol = Server.Protocol.Create(Settings.Default.socket_port);
23 | }
24 |
25 | private void Form1_FormClosing(object sender, FormClosingEventArgs e)
26 | {
27 | _prol.Dispose();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/ServerWinForm/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/ServerWinForm/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace ServerWinForm
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// 应用程序的主入口点。
11 | ///
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Application.Run(new Form1());
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/ServerWinForm/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ServerWinForm")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ServerWinForm")]
13 | [assembly: AssemblyCopyright("版权所有 (C) 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("919d7765-864f-4c8c-9d5c-c18c7bd11e38")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/ServerWinForm/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServerWinForm.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ServerWinForm.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/ServerWinForm/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/ServerWinForm/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServerWinForm.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ServerWinForm/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ServerWinForm/ServerWinForm.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {4622A792-72AA-4519-94D7-E00A90609394}
9 | WinExe
10 | Properties
11 | ServerWinForm
12 | ServerWinForm
13 | v2.0
14 |
15 |
16 |
17 |
18 | 2.0
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Form
48 |
49 |
50 | Form1.cs
51 |
52 |
53 |
54 |
55 | Designer
56 | Form1.cs
57 |
58 |
59 | ResXFileCodeGenerator
60 | Resources.Designer.cs
61 | Designer
62 |
63 |
64 | True
65 | Resources.resx
66 | True
67 |
68 |
69 |
70 | SettingsSingleFileGenerator
71 | Settings.Designer.cs
72 |
73 |
74 | SettingsSingleFileGenerator
75 | Settings.Designer.cs
76 |
77 |
78 | True
79 | Settings.settings
80 | True
81 |
82 |
83 | True
84 | True
85 | Settings.settings
86 |
87 |
88 |
89 |
90 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}
91 | Common
92 |
93 |
94 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}
95 | Server
96 |
97 |
98 |
99 |
106 |
--------------------------------------------------------------------------------
/ServerWinForm/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServerWinForm {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string cs_head {
30 | get {
31 | return ((string)(this["cs_head"]));
32 | }
33 | set {
34 | this["cs_head"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("38888")]
41 | public int socket_port {
42 | get {
43 | return ((int)(this["socket_port"]));
44 | }
45 | set {
46 | this["socket_port"] = value;
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/ServerWinForm/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 38888
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ServerWinForm/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 38888
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ServerWinService/Install1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Configuration.Install;
5 |
6 | namespace ServerWinService {
7 | [RunInstaller(true)]
8 | public partial class Installer1 : Installer {
9 | public Installer1() {
10 | System.ServiceProcess.ServiceInstaller si = new System.ServiceProcess.ServiceInstaller();
11 | System.ServiceProcess.ServiceProcessInstaller spi = new System.ServiceProcess.ServiceProcessInstaller();
12 |
13 | spi.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
14 | si.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
15 | si.ServiceName = "Microsoft MVC 10.0 (Core + PostgreSQL)";
16 | si.Description = "This service must be run automatically.";
17 |
18 | Installers.Add(spi);
19 | Installers.Add(si);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/ServerWinService/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ServiceProcess;
3 | using System.Text;
4 |
5 | namespace ServerWinService {
6 | static class Program {
7 | ///
8 | /// 应用程序的主入口点。
9 | ///
10 | static void Main() {
11 | ServiceBase[] ServicesToRun;
12 |
13 | // 同一进程中可以运行多个用户服务。若要将
14 | // 另一个服务添加到此进程中,请更改下行以
15 | // 创建另一个服务对象。例如,
16 | //
17 | // ServicesToRun = new ServiceBase[] {new Service1(), new MySecondUserService()};
18 | //
19 | ServicesToRun = new ServiceBase[] { new Service1() };
20 |
21 | ServiceBase.Run(ServicesToRun);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/ServerWinService/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列属性集
6 | // 控制。更改这些属性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ServerWinService")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ServerWinService")]
13 | [assembly: AssemblyCopyright("版权所有 (C) 2007")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 属性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("3d782f35-0953-5580-8273-e45d913562b7")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/ServerWinService/ServerWinService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {551011E1-3310-44F2-A7F1-61F559441F66}
9 | WinExe
10 | Properties
11 | ServerWinService
12 | ServerWinService
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 3.5
26 | v2.0
27 | publish\
28 | true
29 | Disk
30 | false
31 | Foreground
32 | 7
33 | Days
34 | false
35 | false
36 | true
37 | 0
38 | 1.0.0.%2a
39 | false
40 | false
41 | true
42 |
43 |
44 | true
45 | full
46 | false
47 | bin\Debug\
48 | DEBUG;TRACE
49 | prompt
50 | 4
51 |
52 |
53 | pdbonly
54 | true
55 | bin\Release\
56 | TRACE
57 | prompt
58 | 4
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | Component
71 |
72 |
73 | Component
74 |
75 |
76 | Service1.cs
77 |
78 |
79 |
80 |
81 | Settings.settings
82 | True
83 | True
84 |
85 |
86 |
87 |
88 |
89 | SettingsSingleFileGenerator
90 | Settings.Designer.cs
91 |
92 |
93 |
94 |
95 | False
96 | .NET Framework 3.5 SP1
97 | true
98 |
99 |
100 |
101 |
102 | {f0054101-9ac9-4e0e-9e78-44ea89fc5c19}
103 | Common
104 |
105 |
106 | {efe1f5d6-ab1f-4fa6-8e10-9b8a197b31c7}
107 | Server
108 |
109 |
110 |
111 |
118 |
--------------------------------------------------------------------------------
/ServerWinService/Service1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ServerWinService {
2 | partial class Service1 {
3 | ///
4 | /// 必需的设计器变量。
5 | ///
6 | private System.ComponentModel.IContainer components = null;
7 |
8 | ///
9 | /// 清理所有正在使用的资源。
10 | ///
11 | /// 如果应释放托管资源,为 true;否则为 false。
12 | protected override void Dispose(bool disposing) {
13 | if (disposing && (components != null)) {
14 | components.Dispose();
15 | }
16 | base.Dispose(disposing);
17 | }
18 |
19 | #region 组件设计器生成的代码
20 |
21 | ///
22 | /// 设计器支持所需的方法 - 不要
23 | /// 使用代码编辑器修改此方法的内容。
24 | ///
25 | private void InitializeComponent() {
26 | components = new System.ComponentModel.Container();
27 | this.ServiceName = "Service1";
28 | }
29 |
30 | #endregion
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ServerWinService/Service1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.IO;
6 | using System.Runtime.Remoting;
7 | using System.ServiceProcess;
8 | using System.Text;
9 |
10 | namespace ServerWinService {
11 | public partial class Service1 : ServiceBase {
12 | public Service1() {
13 | InitializeComponent();
14 | }
15 |
16 | Server.Protocol _prol;
17 | protected override void OnStart(string[] args) {
18 | Deflate.cs_head = Settings.Default.cs_head;
19 | _prol = Server.Protocol.Create(Settings.Default.socket_port);
20 | }
21 |
22 | protected override void OnStop() {
23 | _prol.Dispose();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ServerWinService/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ServerWinService {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string cs_head {
30 | get {
31 | return ((string)(this["cs_head"]));
32 | }
33 | set {
34 | this["cs_head"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("38888")]
41 | public int socket_port {
42 | get {
43 | return ((int)(this["socket_port"]));
44 | }
45 | set {
46 | this["socket_port"] = value;
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/ServerWinService/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 38888
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ServerWinService/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 38888
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 28888
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/core+postgresql.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2018
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeCode", "MakeCode\MakeCode.csproj", "{5FDB8603-9878-49E3-9570-04734FDF1FDE}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{F0054101-9AC9-4E0E-9E78-44EA89FC5C19}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerWinForm", "ServerWinForm\ServerWinForm.csproj", "{4622A792-72AA-4519-94D7-E00A90609394}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerWinService", "ServerWinService\ServerWinService.csproj", "{551011E1-3310-44F2-A7F1-61F559441F66}"
15 | EndProject
16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenPg", "GenPg\GenPg.csproj", "{D3E20B99-A775-4687-9CEA-67FCD5438A86}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Release|Any CPU = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {5FDB8603-9878-49E3-9570-04734FDF1FDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {5FDB8603-9878-49E3-9570-04734FDF1FDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {5FDB8603-9878-49E3-9570-04734FDF1FDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {5FDB8603-9878-49E3-9570-04734FDF1FDE}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {F0054101-9AC9-4E0E-9E78-44EA89FC5C19}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {EFE1F5D6-AB1F-4FA6-8E10-9B8A197B31C7}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {4622A792-72AA-4519-94D7-E00A90609394}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {4622A792-72AA-4519-94D7-E00A90609394}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {4622A792-72AA-4519-94D7-E00A90609394}.Release|Any CPU.ActiveCfg = Release|Any CPU
39 | {4622A792-72AA-4519-94D7-E00A90609394}.Release|Any CPU.Build.0 = Release|Any CPU
40 | {551011E1-3310-44F2-A7F1-61F559441F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41 | {551011E1-3310-44F2-A7F1-61F559441F66}.Debug|Any CPU.Build.0 = Debug|Any CPU
42 | {551011E1-3310-44F2-A7F1-61F559441F66}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {551011E1-3310-44F2-A7F1-61F559441F66}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {D3E20B99-A775-4687-9CEA-67FCD5438A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {D3E20B99-A775-4687-9CEA-67FCD5438A86}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {D3E20B99-A775-4687-9CEA-67FCD5438A86}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {D3E20B99-A775-4687-9CEA-67FCD5438A86}.Release|Any CPU.Build.0 = Release|Any CPU
48 | EndGlobalSection
49 | GlobalSection(SolutionProperties) = preSolution
50 | HideSolutionNode = FALSE
51 | EndGlobalSection
52 | GlobalSection(ExtensibilityGlobals) = postSolution
53 | SolutionGuid = {3F6C454F-DDE3-47E3-AC8E-FEF7E5513132}
54 | EndGlobalSection
55 | EndGlobal
56 |
--------------------------------------------------------------------------------
/docs/_sidebar.md:
--------------------------------------------------------------------------------
1 | - 入门
2 | - [快速开始](zh-cn/quickstart)
3 |
4 | - [创建与管理ER图]](zh-cn/service-intro)
5 | - [基础使用](zh-cn/service-simple)
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | dotnetGen⚡
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/docs/readme.md:
--------------------------------------------------------------------------------
1 | # dotnetGen:zap:
2 |
3 |
4 | 作者面向web应用开发13年,不断的去旧学新吸取每种技术的优点,从强规范、高质量、快速开发方向累积,形成生成器工具减少项目难度。
5 |
6 | 本文档详细介绍 dotnetGen 之 PostgreSQL 生成器的使用帮助,帮忙提高开发效率。
7 |
--------------------------------------------------------------------------------
/log4net.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2881099/dotnetGen_postgresql/c0c75fbd16694993f1cd2cd585b4f961eacf8dbf/log4net.dll
--------------------------------------------------------------------------------
| | | | |