├── .gitignore
├── AutomaticUpdates
├── AutomaticUpdates.csproj
├── BugFixInfo.cs
├── FeatureInfo.cs
├── Properties
│ └── AssemblyInfo.cs
├── UpdateEngine.cs
└── VersionUpdateInfo.cs
├── Common
├── Common.csproj
├── LicenseDetails.cs
├── Properties
│ └── AssemblyInfo.cs
└── UserCancellationException.cs
├── CreateTestDatabases
├── CreateDataChecks_1.cs
├── CreateDataChecks_2.cs
├── CreateDataChecks_3.cs
├── CreateTestDatabases.csproj
├── CreateTriggerChecks_1.cs
├── IDatabasePairCreator.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── TestSchemaFiles
│ └── schema_1.sql
├── Utils.cs
├── app.config
└── packages.config
├── DiffControl
├── BinaryFile.cs
├── ChangeTextAction.cs
├── CharData.cs
├── DiffBar.cs
├── DiffControl.csproj
├── DiffEditBox.cs
├── DiffSnapshot.cs
├── DualDiffControl.Designer.cs
├── DualDiffControl.cs
├── DualDiffControl.resx
├── Engine.cs
├── LineRecord.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Structures.cs
└── TextFile.cs
├── FastGrid
├── FastGrid.cs
├── FastGrid.csproj
├── FastGridCell.cs
├── FastGridCheckBoxCell.cs
├── FastGridColumn.cs
├── FastGridLocation.cs
├── FastGridRow.cs
├── FastGridSelection.cs
├── FastGridStyle.cs
└── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── LICENSE
├── SQLiteParser
├── .gitignore
├── Properties
│ └── AssemblyInfo.cs
├── RefCompare.cs
├── SQLiteBetweenExpression.cs
├── SQLiteBinaryExpression.cs
├── SQLiteCaseExpression.cs
├── SQLiteCaseItem.cs
├── SQLiteCastExpression.cs
├── SQLiteCheckColumnConstraint.cs
├── SQLiteCheckTableConstraint.cs
├── SQLiteCollateColumnConstraint.cs
├── SQLiteCollateExpression.cs
├── SQLiteColumnConstraint.cs
├── SQLiteColumnStatement.cs
├── SQLiteColumnType.cs
├── SQLiteCreateIndexStatement.cs
├── SQLiteCreateTableStatement.cs
├── SQLiteCreateTriggerStatement.cs
├── SQLiteCreateViewStatement.cs
├── SQLiteDdlMain.cs
├── SQLiteDdlStatement.cs
├── SQLiteDefaultColumnConstraint.cs
├── SQLiteDeferColumnConstraint.cs
├── SQLiteDeleteStatement.cs
├── SQLiteDistinct.cs
├── SQLiteExistsExpression.cs
├── SQLiteExpression.cs
├── SQLiteForeignKeyTableConstraint.cs
├── SQLiteFromClause.cs
├── SQLiteFromIndexed.cs
├── SQLiteFromInternalTable.cs
├── SQLiteFromTable.cs
├── SQLiteFunctionExpression.cs
├── SQLiteIdExpression.cs
├── SQLiteInExpression.cs
├── SQLiteIndexedColumn.cs
├── SQLiteInsertPrefix.cs
├── SQLiteInsertStatement.cs
├── SQLiteJoinOperator.cs
├── SQLiteLikeExpression.cs
├── SQLiteLikeOperator.cs
├── SQLiteLimitClause.cs
├── SQLiteMultiSelectStatement.cs
├── SQLiteNameExpression.cs
├── SQLiteNullColumnConstraint.cs
├── SQLiteNullExpression.cs
├── SQLiteObjectName.cs
├── SQLiteOperator.cs
├── SQLiteParser.csproj
├── SQLitePrimaryKeyColumnConstraint.cs
├── SQLitePrimaryKeyTableConstraint.cs
├── SQLiteRaiseExpression.cs
├── SQLiteReferenceHandler.cs
├── SQLiteReferencesColumnConstraint.cs
├── SQLiteResolveAction.cs
├── SQLiteSchema.cs
├── SQLiteSelectColumn.cs
├── SQLiteSelectExpression.cs
├── SQLiteSelectOperator.cs
├── SQLiteSelectStatement.cs
├── SQLiteSingleSelectStatement.cs
├── SQLiteSortItem.cs
├── SQLiteStatement.cs
├── SQLiteTableConstraint.cs
├── SQLiteTerm.cs
├── SQLiteTermExpression.cs
├── SQLiteTriggerEventClause.cs
├── SQLiteTriggerTime.cs
├── SQLiteUnaryExpression.cs
├── SQLiteUniqueColumnConstraint.cs
├── SQLiteUniqueTableConstraint.cs
├── SQLiteUpdateItem.cs
├── SQLiteUpdateStatement.cs
├── SQLiteVariableExpression.cs
├── Utils.cs
├── sqlite.lex
└── sqlite.y
├── SQLiteTurbo
├── AbstractWorker.cs
├── App.config
├── BlobCompareWorker.cs
├── BlobCopier.cs
├── BlobLoader.cs
├── BlobReaderWriter.cs
├── BlobSaver.cs
├── ChangeScriptBuilder.cs
├── CompareParams.cs
├── CompareWorker.cs
├── Configuration.cs
├── DiffExporter.cs
├── EtchedLine.cs
├── Forms
│ ├── AboutDialog.Designer.cs
│ ├── AboutDialog.cs
│ ├── AboutDialog.resx
│ ├── CellValueEditorDialog.Designer.cs
│ ├── CellValueEditorDialog.cs
│ ├── CellValueEditorDialog.resx
│ ├── ChangeScriptDialog.Designer.cs
│ ├── ChangeScriptDialog.cs
│ ├── ChangeScriptDialog.resx
│ ├── CheckUpdatesDialog.Designer.cs
│ ├── CheckUpdatesDialog.cs
│ ├── CheckUpdatesDialog.resx
│ ├── CompareDialog.Designer.cs
│ ├── CompareDialog.cs
│ ├── CompareDialog.resx
│ ├── ExportChangesDialog.Designer.cs
│ ├── ExportChangesDialog.cs
│ ├── ExportChangesDialog.resx
│ ├── FeedbackDialog.Designer.cs
│ ├── FeedbackDialog.cs
│ ├── FeedbackDialog.resx
│ ├── FirstTimeDialog.Designer.cs
│ ├── FirstTimeDialog.cs
│ ├── FirstTimeDialog.resx
│ ├── HttpPostSenderDialog.Designer.cs
│ ├── HttpPostSenderDialog.cs
│ ├── HttpPostSenderDialog.resx
│ ├── IndefiniteProgressDialog.Designer.cs
│ ├── IndefiniteProgressDialog.cs
│ ├── IndefiniteProgressDialog.resx
│ ├── LicenseRegistrationDialog.Designer.cs
│ ├── LicenseRegistrationDialog.cs
│ ├── LicenseRegistrationDialog.resx
│ ├── MainForm.Designer.cs
│ ├── MainForm.cs
│ ├── MainForm.resx
│ ├── ProgressDialog.Designer.cs
│ ├── ProgressDialog.cs
│ ├── ProgressDialog.resx
│ ├── SearchDataRowsDialog.Designer.cs
│ ├── SearchDataRowsDialog.cs
│ ├── SearchDataRowsDialog.resx
│ ├── SoftwareUpdatesDetailsDialog.Designer.cs
│ ├── SoftwareUpdatesDetailsDialog.cs
│ ├── SoftwareUpdatesDetailsDialog.resx
│ ├── TwoWayCompareEditDialog.Designer.cs
│ ├── TwoWayCompareEditDialog.cs
│ ├── TwoWayCompareEditDialog.resx
│ ├── UnexpectedErrorDialog.Designer.cs
│ ├── UnexpectedErrorDialog.cs
│ └── UnexpectedErrorDialog.resx
├── IWorker.cs
├── ItemCopier.cs
├── LicenseManager.cs
├── LocalUserFileAppender.cs
├── MailSender.cs
├── PostSubmitter.cs
├── Program.cs
├── ProgressEventArgs.cs
├── Properties
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── app.ico
│ ├── appicon.ico
│ ├── feedback2.png
│ ├── feedback_non_selected_idea.png
│ ├── feedback_non_selected_question.png
│ ├── feedback_pressed.png
│ ├── feedback_problem_non_selected.png
│ ├── feedback_problem_selected.png
│ ├── feedback_selected_idea.png
│ ├── feedback_selected_question.png
│ ├── normal_feedback_button.png
│ └── pressed_feedback_button.png
├── RowsCopier.cs
├── RowsDeleter.cs
├── SQLiteTurbo.csproj
├── SchemaComparisonItem.cs
├── SchemaComparisonView.Designer.cs
├── SchemaComparisonView.cs
├── SchemaComparisonView.resx
├── SchemaObjectUpdater.cs
├── ScrollableDataGridView.cs
├── ScrollableTreeView.cs
├── SearchDataWorker.cs
├── SelectionBar.cs
├── SendEmailWorker.cs
├── SpinningProgress.Designer.cs
├── SpinningProgress.cs
├── SpinningProgress.resx
├── SyncWorker.cs
├── SyntaxRichTextBox.cs
├── TableChangeItem.cs
├── TableChanges.cs
├── TableCompareWorker.cs
├── TableDiffControl.Designer.cs
├── TableDiffControl.cs
├── TableDiffControl.resx
├── UserSurveyDialog.Designer.cs
├── UserSurveyDialog.cs
├── UserSurveyDialog.resx
├── Utils.cs
├── WebSiteUtils.cs
├── packages.config
└── sqlite.syn
├── SQLiteTurboDiff.sln
├── SVG
├── about.svg
├── accept.svg
├── app.svg
├── appicon.svg
├── bug.svg
├── check_updates.svg
├── close_comparison.svg
├── company_tagline.svg
├── compare.svg
├── copy_from_left_db.svg
├── copy_from_right_db.svg
├── edit_selected_difference.svg
├── feather.svg
├── feedback.svg
├── feedback_frame.svg
├── feedback_non_selected_idea.svg
├── feedback_non_selected_problem.svg
├── feedback_question.svg
├── feedback_selected_problem.svg
├── feedback_selected_question.svg
├── finish_page_banner.svg
├── free.svg
├── generate_script_left_to_right.svg
├── generate_script_right_to_left.svg
├── greenpinesoftware_logo.svg
├── home_screenshot.svg
├── installer_banner.svg
├── key.svg
├── lamp.svg
├── lamp_non_selected.svg
├── lamp_selected.svg
├── lock.svg
├── main_screen.svg
├── next_diff.svg
├── prev_diff.svg
├── question.svg
├── recycle_bin.svg
├── redo.svg
├── reject.svg
├── reorder_columns.svg
├── save_schema.svg
├── search.svg
├── smallbug.svg
├── sqlite_compare_logo.svg
├── sqlite_feather.svg
├── text2451.png
├── undo.svg
├── uninstall.svg
└── v_bullet.svg
├── Setup
├── Thumbs.db
├── appicon.ico
├── changes.txt
├── finish_banner.bmp
├── installer_banner.bmp
├── setup.nsi
└── uninstallicon.ico
├── ShiftReduceParser.dll
├── SolutionInfo.cs
├── UndoRedo
├── ActionRecord.cs
├── Properties
│ └── AssemblyInfo.cs
├── UndoManager.cs
├── UndoRedo.csproj
└── UndoableAction.cs
├── eula.txt
├── gplex.exe
├── gplexx.frame
├── gppg.exe
├── license.lic
└── readme.txt
/AutomaticUpdates/BugFixInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace AutomaticUpdates
6 | {
7 | ///
8 | /// Contains information regarding a bug that was fixed
9 | ///
10 | [Serializable]
11 | public class BugFixInfo
12 | {
13 | public BugFixInfo()
14 | {
15 | }
16 |
17 | public BugFixInfo(BugSeverity severity, string description)
18 | {
19 | _severity = severity;
20 | _description = description;
21 | }
22 |
23 | ///
24 | /// Get the severity level of the bug
25 | ///
26 | public BugSeverity Severity
27 | {
28 | get { return _severity; }
29 | set { _severity = value; }
30 | }
31 |
32 | ///
33 | /// Get the description of the bug
34 | ///
35 | public string Description
36 | {
37 | get { return _description; }
38 | set { _description = value; }
39 | }
40 |
41 | private BugSeverity _severity;
42 | private string _description;
43 | }
44 |
45 | ///
46 | /// Enumerates the possible severity levels for bugs
47 | ///
48 | public enum BugSeverity
49 | {
50 | None = 0,
51 |
52 | Minor = 1,
53 |
54 | Major = 2,
55 |
56 | Critical = 3,
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/AutomaticUpdates/FeatureInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace AutomaticUpdates
6 | {
7 | ///
8 | /// Describes a feature that was added to the software
9 | ///
10 | [Serializable]
11 | public class FeatureInfo
12 | {
13 | public FeatureInfo()
14 | {
15 | }
16 |
17 | ///
18 | /// Creates a new feature info object with the specified impact and description
19 | ///
20 | /// The impact of the feature
21 | /// The description of the feature
22 | public FeatureInfo(FeatureImpact impact, string description)
23 | {
24 | _impact = impact;
25 | _description = description;
26 | }
27 |
28 | ///
29 | /// Get the impact of the feature on the system
30 | ///
31 | public FeatureImpact Impact
32 | {
33 | get { return _impact; }
34 | set { _impact = value; }
35 | }
36 |
37 | ///
38 | /// Get the description of the feature
39 | ///
40 | public string Description
41 | {
42 | get { return _description; }
43 | set { _description = value; }
44 | }
45 |
46 | private FeatureImpact _impact;
47 | private string _description;
48 | }
49 |
50 | ///
51 | /// Describes the impart of the added feature
52 | ///
53 | public enum FeatureImpact
54 | {
55 | None = 0,
56 |
57 | Minor = 1,
58 |
59 | Major = 2,
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/AutomaticUpdates/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
--------------------------------------------------------------------------------
/AutomaticUpdates/VersionUpdateInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace AutomaticUpdates
6 | {
7 | ///
8 | /// This class describes the various updates that occured from the last version to
9 | /// the current version. It also includes the version string of the current version
10 | /// and the version string of the previous version.
11 | ///
12 | [Serializable]
13 | public class VersionUpdateInfo
14 | {
15 | #region Constructors
16 | public VersionUpdateInfo()
17 | {
18 | }
19 |
20 | public VersionUpdateInfo(string version, DateTime releaseDate)
21 | {
22 | _version = version;
23 | _releaseDate = releaseDate;
24 | }
25 | #endregion
26 |
27 | #region Public Properties
28 | public string Version
29 | {
30 | get { return _version; }
31 | set { _version = value; }
32 | }
33 |
34 | public DateTime ReleaseDate
35 | {
36 | get { return _releaseDate; }
37 | set { _releaseDate = value; }
38 | }
39 |
40 | public List FixedBugs
41 | {
42 | get { return _fixedBugs; }
43 | set { _fixedBugs = value; }
44 | }
45 |
46 | public List AddedFeatures
47 | {
48 | get { return _addedFeatures; }
49 | set { _addedFeatures = value; }
50 | }
51 | #endregion
52 |
53 | #region Private Variables
54 | private string _version;
55 | private DateTime _releaseDate;
56 | private List _fixedBugs = new List();
57 | private List _addedFeatures = new List();
58 | #endregion
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Common/LicenseDetails.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Common
6 | {
7 | ///
8 | /// This class holds the license information
9 | ///
10 | [Serializable]
11 | public class LicenseDetails
12 | {
13 | public int DemoDays
14 | {
15 | get
16 | {
17 | return _demoDays;
18 | }
19 | set
20 | {
21 | _demoDays = value;
22 | }
23 | }
24 |
25 | public string CustomerName
26 | {
27 | get { return _customerName; }
28 | set { _customerName = value; }
29 | }
30 |
31 | public string ContactEmail
32 | {
33 | get { return _email; }
34 | set { _email = value; }
35 | }
36 |
37 | public int NumberOfSeats
38 | {
39 | get { return _numberOfSeats; }
40 | set { _numberOfSeats = value; }
41 | }
42 |
43 | public LicenseUsage Usage
44 | {
45 | get { return _usage; }
46 | set { _usage = value; }
47 | }
48 |
49 | public bool IsSiteLicense
50 | {
51 | get { return _siteLicense; }
52 | set { _siteLicense = value; }
53 | }
54 |
55 | public override string ToString()
56 | {
57 | return _demoDays+DELIM+_customerName + DELIM + _usage.ToString() + DELIM + _numberOfSeats.ToString() + DELIM + _siteLicense.ToString()+DELIM+_email;
58 | }
59 |
60 | public static LicenseDetails Parse(string str)
61 | {
62 | string[] parts = str.Split(new string[] { "!+-!" }, StringSplitOptions.None);
63 | if (parts.Length != 6)
64 | throw new ArgumentException("illegal license string");
65 |
66 | LicenseDetails res = new LicenseDetails();
67 | res._demoDays = int.Parse(parts[0]);
68 | res._customerName = parts[1];
69 | res._usage = (LicenseUsage)Enum.Parse(typeof(LicenseUsage), parts[2]);
70 | res._numberOfSeats = int.Parse(parts[3]);
71 | res._siteLicense = bool.Parse(parts[4]);
72 | res._email = parts[5];
73 | return res;
74 | }
75 |
76 | private const string DELIM = "!+-!";
77 |
78 | private bool _siteLicense;
79 | private LicenseUsage _usage;
80 | private int _numberOfSeats;
81 | private string _customerName;
82 | private int _demoDays;
83 | private string _email;
84 | }
85 |
86 | public enum LicenseUsage
87 | {
88 | Demo = 0,
89 |
90 | Academic = 1,
91 |
92 | Personal = 2,
93 |
94 | Commercial = 3,
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/Common/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Common")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Common")]
13 | [assembly: AssemblyCopyright("Copyright © 2009")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c4e2c7bf-fb4e-4b18-8ca2-cfc04b4142ed")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Common/UserCancellationException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Common
6 | {
7 | ///
8 | /// Used to indicate that the user chose to cancel the operation
9 | ///
10 | public class UserCancellationException : Exception
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CreateTestDatabases/CreateDataChecks_1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Data.SQLite;
6 |
7 | namespace CreateTestDatabases
8 | {
9 | public class CreateDataChecks_1 : IDatabasePairCreator
10 | {
11 |
12 | #region IDatabasePairCreator Members
13 |
14 | public void CreatePair(string db1, string db2)
15 | {
16 | if (File.Exists(db1))
17 | File.Delete(db1);
18 | if (File.Exists(db2))
19 | File.Delete(db2);
20 | SQLiteConnection.CreateFile(db1);
21 |
22 | using (SQLiteConnection c1 = Utils.CreateConnection(db1))
23 | {
24 | c1.Open();
25 |
26 | Utils.RunCommand(
27 | @" CREATE TABLE test1 " +
28 | @" (" +
29 | @" tblob TINYBLOB, " +
30 | @" blob BLOB, " +
31 | @" mblob MEDIUMBLOB, " +
32 | @" ba BYTEA" +
33 | @" )", c1);
34 |
35 | byte[] f1 = new byte[] { 1 };
36 | byte[] f2 = new byte[] { 1, 2 };
37 | byte[] f3 = new byte[] { 1, 2, 3 };
38 | byte[] f4 = new byte[] { 1, 2, 3, 4 };
39 |
40 | byte[][] tarr = new byte[][] { f1, f2, f3, f4 };
41 |
42 | SQLiteTransaction tx1 = c1.BeginTransaction();
43 | InsertData(tarr, c1, tx1);
44 | tx1.Commit();
45 |
46 | File.Copy(db1, db2);
47 | } // using
48 | }
49 |
50 | private void InsertData(byte[][] tarr, SQLiteConnection conn, SQLiteTransaction tx)
51 | {
52 | Random rand = new Random();
53 | SQLiteCommand insert = new SQLiteCommand("INSERT INTO test1 (tblob,blob,mblob,ba) VALUES (@f1, @f2, @f3, @f4)", conn, tx);
54 | insert.Parameters.Add("@f1", System.Data.DbType.Binary);
55 | insert.Parameters.Add("@f2", System.Data.DbType.Binary);
56 | insert.Parameters.Add("@f3", System.Data.DbType.Binary);
57 | insert.Parameters.Add("@f4", System.Data.DbType.Binary);
58 |
59 | for (int i = 0; i < 100; i++)
60 | {
61 | for (int k = 1; k <= tarr.Length; k++)
62 | {
63 | int index = rand.Next(0, tarr.Length - 1);
64 | insert.Parameters["@f" + k].Value = tarr[index];
65 | }
66 | insert.ExecuteNonQuery();
67 | } // for
68 | }
69 |
70 | #endregion
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/CreateTestDatabases/CreateDataChecks_2.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Data.SQLite;
5 | using System.IO;
6 |
7 | namespace CreateTestDatabases
8 | {
9 | public class CreateDataChecks_2 : IDatabasePairCreator
10 | {
11 | #region IDatabasePairCreator Members
12 |
13 | public void CreatePair(string db1, string db2)
14 | {
15 | if (File.Exists(db1))
16 | File.Delete(db1);
17 | if (File.Exists(db2))
18 | File.Delete(db2);
19 | SQLiteConnection.CreateFile(db1);
20 |
21 | using (SQLiteConnection c1 = Utils.CreateConnection(db1))
22 | {
23 | c1.Open();
24 |
25 | Utils.RunCommand(
26 | @" CREATE TABLE test1 " +
27 | @" (" +
28 | @" ascending integer NOT NULL PRIMARY KEY," +
29 | @" t1 char," +
30 | @" t2 char(10),"+
31 | @" t3 varchar,"+
32 | @" t4 varchar(50),"+
33 | @" t5 nchar,"+
34 | @" t6 nchar(10),"+
35 | @" t7 text,"+
36 | @" t8 tinytext,"+
37 | @" t9 mediumtext,"+
38 | @" t10 longtext"+
39 | @" )", c1);
40 |
41 | SQLiteTransaction tx1 = c1.BeginTransaction();
42 | InsertData(c1, tx1);
43 | tx1.Commit();
44 |
45 | File.Copy(db1, db2);
46 | } // using
47 | }
48 |
49 | #endregion
50 |
51 | private void InsertData(SQLiteConnection conn, SQLiteTransaction tx)
52 | {
53 | Random rand = new Random();
54 | SQLiteCommand insert = new SQLiteCommand("INSERT INTO test1 " +
55 | "(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10) VALUES " +
56 | "('a','b','c','d','e','f','e','g','h','i')", conn, tx);
57 |
58 | for (int i = 0; i < 100; i++)
59 | {
60 | insert.ExecuteNonQuery();
61 | } // for
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/CreateTestDatabases/CreateDataChecks_3.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Data.SQLite;
5 | using System.IO;
6 |
7 | namespace CreateTestDatabases
8 | {
9 | public class CreateDataChecks_3 : IDatabasePairCreator
10 | {
11 | #region IDatabasePairCreator Members
12 |
13 | public void CreatePair(string db1, string db2)
14 | {
15 | if (File.Exists(db1))
16 | File.Delete(db1);
17 | if (File.Exists(db2))
18 | File.Delete(db2);
19 | SQLiteConnection.CreateFile(db1);
20 |
21 | using (SQLiteConnection c1 = Utils.CreateConnection(db1))
22 | {
23 | c1.Open();
24 |
25 | Utils.RunCommand(
26 | "CREATE TABLE log (" +
27 | " id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," +
28 | " user_id INTEGER NULL DEFAULT NULL," +
29 | " type_id INTEGER NOT NULL," +
30 | " severity_id TINYINT NOT NULL," +
31 | " message VARCHAR(255) NOT NULL," +
32 | " data LONGBLOB NULL," +
33 | " timestamp DATETIME NOT NULL," +
34 | " ip INTEGER UNSIGNED NOT NULL" +
35 | " )", c1);
36 |
37 | Utils.RunCommand(
38 | "CREATE TABLE test1 (" +
39 | " a," +
40 | " b COLLATE BINARY," +
41 | " c COLLATE RTRIM," +
42 | " d COLLATE NOCASE" +
43 | ")", c1);
44 |
45 | SQLiteTransaction tx1 = c1.BeginTransaction();
46 | InsertData(c1, tx1);
47 | tx1.Commit();
48 |
49 | File.Copy(db1, db2);
50 | } // using
51 | }
52 |
53 | #endregion
54 |
55 | private void InsertData(SQLiteConnection conn, SQLiteTransaction tx)
56 | {
57 | Random rand = new Random();
58 | SQLiteCommand insert1 = new SQLiteCommand("INSERT INTO log " +
59 | "(user_id,type_id,severity_id,message,data, timestamp,ip) VALUES " +
60 | "(1,2,3,'message',X'01020304','2004-12-12',4)", conn, tx);
61 |
62 | SQLiteCommand insert2 = new SQLiteCommand("INSERT INTO test1 (a,b,c,d) VALUES " +
63 | "(1,2,'c','d')", conn, tx);
64 |
65 | for (int i = 0; i < 100; i++)
66 | {
67 | insert1.ExecuteNonQuery();
68 | insert2.ExecuteNonQuery();
69 | } // for
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/CreateTestDatabases/IDatabasePairCreator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CreateTestDatabases
6 | {
7 | public interface IDatabasePairCreator
8 | {
9 | void CreatePair(string db1, string db2);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CreateTestDatabases/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace CreateTestDatabases
6 | {
7 | class Program
8 | {
9 | static IDatabasePairCreator[] _checks = new IDatabasePairCreator[]
10 | {
11 | new CreateDataChecks_1(),
12 | new CreateDataChecks_2(),
13 | new CreateDataChecks_3(),
14 | new CreateTriggerChecks_1(),
15 | };
16 |
17 | static void Main(string[] args)
18 | {
19 | for (int i = 0; i < _checks.Length; i++)
20 | {
21 | // Mickey Mouse
22 | _checks[i].CreatePair("test_left_" + i + ".db", "test_right_" + i + ".db");
23 | } // for
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CreateTestDatabases/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CreateTestDatabases")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CreateTestDatabases")]
13 | [assembly: AssemblyCopyright("Copyright © 2009")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9b62b035-d4df-4de6-8d83-45e29678016b")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/CreateTestDatabases/Utils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Data.SQLite;
5 |
6 | namespace CreateTestDatabases
7 | {
8 | public class Utils
9 | {
10 | public static SQLiteConnection CreateConnection(string dbpath)
11 | {
12 | SQLiteConnectionStringBuilder builder = new SQLiteConnectionStringBuilder();
13 | builder.DataSource = dbpath;
14 | return new SQLiteConnection(builder.ConnectionString);
15 | }
16 |
17 | public static void RunCommand(string command, params SQLiteConnection[] clist)
18 | {
19 | foreach (SQLiteConnection conn in clist)
20 | {
21 | SQLiteCommand cmd = new SQLiteCommand(command, conn);
22 | cmd.ExecuteNonQuery();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CreateTestDatabases/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CreateTestDatabases/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DiffControl/BinaryFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Collections;
4 |
5 | namespace DifferenceEngine
6 | {
7 | public class DiffList_BinaryFile : IDiffList
8 | {
9 | private byte[] _byteList;
10 |
11 | public DiffList_BinaryFile(string fileName)
12 | {
13 | FileStream fs = null;
14 | BinaryReader br = null;
15 | try
16 | {
17 | fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
18 | int len = (int)fs.Length;
19 | br = new BinaryReader(fs);
20 | _byteList = br.ReadBytes(len);
21 | }
22 | catch (Exception ex)
23 | {
24 | throw ex;
25 | }
26 | finally
27 | {
28 | if (br != null) br.Close();
29 | if (fs != null) fs.Close();
30 | }
31 |
32 | }
33 | #region IDiffList Members
34 |
35 | public int Count()
36 | {
37 | return _byteList.Length;
38 | }
39 |
40 | public IComparable GetByIndex(int index)
41 | {
42 | return _byteList[index];
43 | }
44 |
45 | #endregion
46 | }
47 | }
--------------------------------------------------------------------------------
/DiffControl/ChangeTextAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using UndoRedo;
5 |
6 | namespace DiffControl
7 | {
8 | ///
9 | /// Encapsulates the case when any element of text was changed
10 | /// in one of the two diff edit boxes (dual diff control)
11 | ///
12 | public class ChangeTextAction : UndoableAction
13 | {
14 | public ChangeTextAction(DiffEditBox left, DiffEditBox right,
15 | DiffSnapshot beforeLeft, DiffSnapshot afterLeft,
16 | DiffSnapshot beforeRight, DiffSnapshot afterRight)
17 | {
18 | _left = left;
19 | _right = right;
20 | _beforeLeft = beforeLeft;
21 | _beforeRight = beforeRight;
22 | _afterLeft = afterLeft;
23 | _afterRight = afterRight;
24 | }
25 |
26 | public override string Name
27 | {
28 | get { return "Change Text"; }
29 | }
30 |
31 | public override string Description
32 | {
33 | get { return "Text was changed"; }
34 | }
35 |
36 | public override void Do(bool redo)
37 | {
38 | if (redo)
39 | {
40 | _left.SetSnapshot(_afterLeft);
41 | _right.SetSnapshot(_afterRight);
42 | }
43 | }
44 |
45 | public override void Undo()
46 | {
47 | _left.SetSnapshot(_beforeLeft);
48 | _right.SetSnapshot(_beforeRight);
49 | }
50 |
51 | private DiffEditBox _left;
52 | private DiffEditBox _right;
53 | private DiffSnapshot _beforeLeft;
54 | private DiffSnapshot _afterLeft;
55 | private DiffSnapshot _beforeRight;
56 | private DiffSnapshot _afterRight;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/DiffControl/CharData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 |
4 | namespace DifferenceEngine
5 | {
6 | public class DiffList_CharData : IDiffList
7 | {
8 | private char[] _charList;
9 |
10 | public DiffList_CharData(string charData)
11 | {
12 | _charList = charData.ToCharArray();
13 | }
14 | #region IDiffList Members
15 |
16 | public int Count()
17 | {
18 | return _charList.Length;
19 | }
20 |
21 | public IComparable GetByIndex(int index)
22 | {
23 | return _charList[index];
24 | }
25 |
26 | #endregion
27 | }
28 | }
--------------------------------------------------------------------------------
/DiffControl/DiffSnapshot.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace DiffControl
6 | {
7 | ///
8 | /// Encapsulates the full state of the diff edit box (including lines, cursor, selection etc)
9 | /// so it can be restored later.
10 | ///
11 | public class DiffSnapshot : ICloneable
12 | {
13 | #region Constructors
14 | public DiffSnapshot(List lines, DiffEditPosition cursor,
15 | DiffEditRange selection, int lineIndex, int column,
16 | bool modified, bool synched)
17 | {
18 | if (lines == null)
19 | _lines = null;
20 | else
21 | {
22 | _lines = new List();
23 | foreach (LineRecord lrec in lines)
24 | _lines.Add((LineRecord)lrec.Clone());
25 | } // else
26 | _cursor = cursor;
27 | _selection = selection;
28 | _lineIndex = lineIndex;
29 | _columnIndex = column;
30 | _modified = modified;
31 | _synched = synched;
32 | }
33 | #endregion
34 |
35 | #region ICloneable Members
36 |
37 | public object Clone()
38 | {
39 | DiffSnapshot res = new DiffSnapshot(_lines, _cursor, _selection, _lineIndex, _columnIndex, _modified, _synched);
40 | return res;
41 | }
42 |
43 | #endregion
44 |
45 | #region Public Properties
46 | public List Lines
47 | {
48 | get { return _lines; }
49 | }
50 |
51 | public DiffEditPosition Cursor
52 | {
53 | get { return _cursor; }
54 | set { _cursor = value; }
55 | }
56 |
57 | public DiffEditRange Selection
58 | {
59 | get { return _selection; }
60 | set { _selection = value; }
61 | }
62 |
63 | public int LineIndex
64 | {
65 | get { return _lineIndex; }
66 | set { _lineIndex = value; }
67 | }
68 |
69 | public int ColumnIndex
70 | {
71 | get { return _columnIndex; }
72 | set { _columnIndex = value; }
73 | }
74 |
75 | public bool IsModified
76 | {
77 | get { return _modified; }
78 | set { _modified = value; }
79 | }
80 |
81 | public bool IsSynched
82 | {
83 | get { return _synched; }
84 | set { _synched = value; }
85 | }
86 | #endregion
87 |
88 | #region Private Variables
89 | private List _lines;
90 | private DiffEditPosition _cursor;
91 | private DiffEditRange _selection;
92 | private int _lineIndex;
93 | private int _columnIndex;
94 | private bool _modified;
95 | private bool _synched;
96 | #endregion
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/DiffControl/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DiffControl")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DiffControl")]
13 | [assembly: AssemblyCopyright("Copyright © 2009")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2ec6aa69-1360-4db9-838d-5e188c37b274")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/DiffControl/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DiffControl.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
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 | /// Returns the cached ResourceManager instance used by this class.
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("DiffControl.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
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 |
--------------------------------------------------------------------------------
/DiffControl/TextFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Collections;
4 |
5 | namespace DifferenceEngine
6 | {
7 | public class TextLine : IComparable
8 | {
9 | public string Line;
10 | public int _hash;
11 |
12 | public TextLine(string str)
13 | {
14 | Line = str.Replace("\t"," ");
15 | _hash = str.GetHashCode();
16 | }
17 | #region IComparable Members
18 |
19 | public int CompareTo(object obj)
20 | {
21 | return _hash.CompareTo(((TextLine)obj)._hash);
22 | }
23 |
24 | #endregion
25 | }
26 |
27 |
28 | public class DiffList_TextFile : IDiffList
29 | {
30 | private const int MaxLineLength = 1024;
31 | private ArrayList _lines;
32 |
33 | public DiffList_TextFile(string[] lines)
34 | {
35 | _lines = new ArrayList();
36 | foreach (string line in lines)
37 | _lines.Add(new TextLine(line));
38 | }
39 |
40 | public DiffList_TextFile(string fileName)
41 | {
42 | _lines = new ArrayList();
43 | using (StreamReader sr = new StreamReader(fileName))
44 | {
45 | String line;
46 | // Read and display lines from the file until the end of
47 | // the file is reached.
48 | while ((line = sr.ReadLine()) != null)
49 | {
50 | if (line.Length > MaxLineLength)
51 | {
52 | throw new InvalidOperationException(
53 | string.Format("File contains a line greater than {0} characters.",
54 | MaxLineLength.ToString()));
55 | }
56 | _lines.Add(new TextLine(line));
57 | }
58 | }
59 | }
60 | #region IDiffList Members
61 |
62 | public int Count()
63 | {
64 | return _lines.Count;
65 | }
66 |
67 | public IComparable GetByIndex(int index)
68 | {
69 | return (TextLine)_lines[index];
70 | }
71 |
72 | #endregion
73 |
74 | }
75 | }
--------------------------------------------------------------------------------
/FastGrid/FastGridCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 | using System.Windows.Forms;
6 |
7 | namespace FastGridApp
8 | {
9 | public class FastGridCell
10 | {
11 | public FastGridCell(FastGrid owner)
12 | {
13 | _owner = owner;
14 | }
15 |
16 | public object Value
17 | {
18 | get { return _value; }
19 | set { _value = value; }
20 | }
21 |
22 | public FastGridStyle Style
23 | {
24 | get { return _style; }
25 | }
26 |
27 | public virtual void OnPaint(Graphics g, Rectangle bbox, bool isRowSelected)
28 | {
29 | if (isRowSelected)
30 | {
31 | g.FillRectangle(SystemBrushes.Highlight, bbox);
32 | }
33 | else
34 | {
35 | using (SolidBrush b = new SolidBrush(GetBackColor()))
36 | g.FillRectangle(b, bbox);
37 | }
38 |
39 | if (_value != null)
40 | {
41 | Font f = GetFont();
42 | int fh = (int)Math.Ceiling(f.GetHeight(g));
43 |
44 | if (isRowSelected)
45 | {
46 | g.DrawString(_value.ToString(), GetFont(), SystemBrushes.HighlightText,
47 | new Rectangle(bbox.X, bbox.Y + (bbox.Height - fh) / 2, bbox.Width, fh), _fmt);
48 | }
49 | else
50 | {
51 | using (SolidBrush b = new SolidBrush(GetForeColor()))
52 | g.DrawString(_value.ToString(), GetFont(), b,
53 | new Rectangle(bbox.X, bbox.Y + (bbox.Height - fh) / 2, bbox.Width, fh), _fmt);
54 | }
55 | }
56 | }
57 |
58 | protected Color GetForeColor()
59 | {
60 | if (_style.ForeColor == Color.Empty)
61 | return _owner.ForeColor;
62 | else
63 | return _style.ForeColor;
64 | }
65 |
66 | protected Color GetBackColor()
67 | {
68 | if (_style.BackColor == Color.Empty)
69 | return _owner.BackColor;
70 | else
71 | return _style.BackColor;
72 | }
73 |
74 | protected Font GetFont()
75 | {
76 | if (_style.Font == null)
77 | return _owner.Font;
78 | else
79 | return _style.Font;
80 | }
81 |
82 | private object _value;
83 | private FastGrid _owner;
84 | private FastGridStyle _style = new FastGridStyle();
85 | private StringFormat _fmt = new StringFormat(StringFormatFlags.NoWrap);
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/FastGrid/FastGridCheckBoxCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 | using System.Windows.Forms;
6 |
7 |
8 | namespace FastGridApp
9 | {
10 | public class FastGridCheckBoxCell : FastGridCell
11 | {
12 | public FastGridCheckBoxCell(FastGrid owner)
13 | : base(owner)
14 | {
15 | }
16 |
17 | public override void OnPaint(Graphics g, Rectangle bbox, bool isRowSelected)
18 | {
19 | if (isRowSelected)
20 | {
21 | g.FillRectangle(SystemBrushes.Highlight, bbox);
22 | }
23 | else
24 | {
25 | using (SolidBrush b = new SolidBrush(GetBackColor()))
26 | g.FillRectangle(b, bbox);
27 | }
28 |
29 | if (Value != null)
30 | {
31 | Font f = GetFont();
32 | int fh = (int)Math.Ceiling(f.GetHeight(g));
33 |
34 | if (Value is bool)
35 | {
36 | ControlPaint.DrawCheckBox(g, new Rectangle(bbox.X, bbox.Y + (bbox.Height - fh) / 2, bbox.Width, fh),
37 | ((bool)Value) ? ButtonState.Checked : ButtonState.Normal);
38 | }
39 | else
40 | {
41 | if (isRowSelected)
42 | {
43 | g.DrawString(Value.ToString(), GetFont(), SystemBrushes.HighlightText,
44 | new Rectangle(bbox.X, bbox.Y + (bbox.Height - fh) / 2, bbox.Width, fh), _fmt);
45 | }
46 | else
47 | {
48 | using (SolidBrush b = new SolidBrush(GetForeColor()))
49 | g.DrawString(Value.ToString(), GetFont(), b,
50 | new Rectangle(bbox.X, bbox.Y + (bbox.Height - fh) / 2, bbox.Width, fh), _fmt);
51 | }
52 | } // else
53 | }
54 | }
55 |
56 | private StringFormat _fmt = new StringFormat(StringFormatFlags.NoWrap);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/FastGrid/FastGridColumn.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 |
6 | namespace FastGridApp
7 | {
8 | public class FastGridColumn
9 | {
10 | public FastGridColumn(string text)
11 | {
12 | _text = text;
13 | }
14 |
15 | public FastGridColumn(Image img, string text)
16 | {
17 | _text = text;
18 | _img = img;
19 | }
20 |
21 | public FastGridColumn(string text, FastGridColumnType ctype)
22 | {
23 | _text = text;
24 | _ctype = ctype;
25 | }
26 |
27 | public FastGridColumn(Image img, string text, FastGridColumnType ctype)
28 | {
29 | _text = text;
30 | _ctype = ctype;
31 | _img = img;
32 | }
33 |
34 | public string Text
35 | {
36 | get { return _text; }
37 | set { _text = value; }
38 | }
39 |
40 | public Image Image
41 | {
42 | get { return _img; }
43 | set { _img = value; }
44 | }
45 |
46 | public FastGridColumnType ColumnType
47 | {
48 | get { return _ctype; }
49 | set { _ctype = value; }
50 | }
51 |
52 | public int Width
53 | {
54 | get { return _width; }
55 | set { _width = value; }
56 | }
57 |
58 | public object Tag
59 | {
60 | get { return _tag; }
61 | set { _tag = value; }
62 | }
63 |
64 | private object _tag;
65 | private string _text;
66 | private Image _img;
67 | private int _width = 100;
68 | private FastGridColumnType _ctype = FastGridColumnType.Text;
69 | }
70 |
71 | public enum FastGridColumnType
72 | {
73 | None = 0,
74 |
75 | Text = 1,
76 |
77 | CheckBox = 2,
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/FastGrid/FastGridLocation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FastGridApp
6 | {
7 | ///
8 | /// Represents a location in the grid (Row/Column)
9 | ///
10 | public struct FastGridLocation
11 | {
12 | public static readonly FastGridLocation Empty = new FastGridLocation(long.MinValue, int.MinValue);
13 |
14 | public FastGridLocation(long row, int col)
15 | {
16 | RowIndex = row;
17 | ColumnIndex = col;
18 | }
19 |
20 | public override bool Equals(object obj)
21 | {
22 | if (obj == null)
23 | return false;
24 |
25 | if (!(obj is FastGridLocation))
26 | return false;
27 |
28 | FastGridLocation loc = (FastGridLocation)obj;
29 | if (loc.RowIndex != RowIndex)
30 | return false;
31 | if (loc.ColumnIndex != ColumnIndex)
32 | return false;
33 |
34 | return true;
35 | }
36 |
37 | public static bool operator ==(FastGridLocation obj1, FastGridLocation obj2)
38 | {
39 | return obj1.Equals(obj2);
40 | }
41 |
42 | public static bool operator !=(FastGridLocation obj1, FastGridLocation obj2)
43 | {
44 | return !obj1.Equals(obj2);
45 | }
46 |
47 | public override int GetHashCode()
48 | {
49 | return RowIndex.GetHashCode() * ColumnIndex.GetHashCode();
50 | }
51 |
52 | public override string ToString()
53 | {
54 | return "Row=" + RowIndex + ",Col=" + ColumnIndex;
55 | }
56 |
57 | public long RowIndex;
58 | public int ColumnIndex;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FastGrid/FastGridRow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FastGridApp
6 | {
7 | public class FastGridRow
8 | {
9 | public FastGridRow(FastGrid owner)
10 | {
11 | _owner = owner;
12 | }
13 |
14 | public FastGridCell[] Cells
15 | {
16 | get { return _cells; }
17 | set { _cells = value; }
18 | }
19 |
20 | public FastGridStyle Style
21 | {
22 | get { return _style; }
23 | }
24 |
25 | public object Tag
26 | {
27 | get { return _tag; }
28 | }
29 |
30 | private object _tag;
31 | private FastGrid _owner;
32 | private FastGridStyle _style = new FastGridStyle();
33 | private FastGridCell[] _cells;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/FastGrid/FastGridStyle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Drawing;
5 |
6 | namespace FastGridApp
7 | {
8 | public class FastGridStyle
9 | {
10 | public Font Font
11 | {
12 | get { return _font; }
13 | set { _font = value; }
14 | }
15 |
16 | public Color BackColor
17 | {
18 | get { return _backColor; }
19 | set { _backColor = value; }
20 | }
21 |
22 | public Color ForeColor
23 | {
24 | get { return _foreColor; }
25 | set { _foreColor = value; }
26 | }
27 |
28 | private Font _font;
29 | private Color _backColor;
30 | private Color _foreColor;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FastGrid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FastGrid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FastGrid")]
13 | [assembly: AssemblyCopyright("Copyright © 2009")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("5a174348-a2a6-4e4e-8227-8518eee719f1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/FastGrid/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FastGridApp.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
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 | /// Returns the cached ResourceManager instance used by this class.
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("FastGridApp.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
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 |
--------------------------------------------------------------------------------
/FastGrid/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FastGridApp.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.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 |
--------------------------------------------------------------------------------
/FastGrid/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SQLiteParser/.gitignore:
--------------------------------------------------------------------------------
1 | #Generated by build process.
2 | SQLiteLexer.cs
3 | SQLiteParser.cs
--------------------------------------------------------------------------------
/SQLiteParser/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SQLiteParser")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SQLiteParser")]
13 | [assembly: AssemblyCopyright("Copyright © 2009")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("5f0f0a43-c174-4dca-9afe-31750a98e048")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/SQLiteParser/RefCompare.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class RefCompare
8 | {
9 | public static bool Compare(object t1, object t2)
10 | {
11 | if (t1 == null && t2 != null || t1 != null && t2 == null)
12 | return false;
13 | if (t1 == null && t2 == null)
14 | return true;
15 | if (!t1.Equals(t2))
16 | return false;
17 | return true;
18 | }
19 |
20 | public static bool CompareMany(params object[] args)
21 | {
22 | if (args == null || args.Length % 2 != 0)
23 | throw new ArgumentException();
24 |
25 | for (int i = 0; i < args.Length; )
26 | {
27 | if (!Compare(args[i], args[i + 1]))
28 | return false;
29 | i += 2;
30 | } // for
31 |
32 | return true;
33 | }
34 |
35 | public static bool CompareList(List i1, List i2) where I : class
36 | {
37 | if (i1 == null && i2 != null || i1 != null && i2 == null)
38 | return false;
39 | if (i1 == null && i2 == null)
40 | return true;
41 | if (i1.Count != i2.Count)
42 | return false;
43 | for (int i = 0; i < i1.Count; i++)
44 | {
45 | if (i1[i] == null && i2[i] != null)
46 | return false;
47 | if (i1[i] != null && i2[i] == null)
48 | return false;
49 | if (i1[i] != null && i2[i] != null)
50 | {
51 | if (!i1[i].Equals(i2[i]))
52 | return false;
53 | }
54 | } // for
55 |
56 | return true;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteBetweenExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteBetweenExpression : SQLiteExpression
8 | {
9 | public SQLiteBetweenExpression()
10 | {
11 | }
12 |
13 | public SQLiteBetweenExpression(SQLiteExpression left, bool between, SQLiteExpression right, SQLiteExpression and)
14 | {
15 | _left = left;
16 | _between = between;
17 | _right = right;
18 | _and = and;
19 | }
20 |
21 | public SQLiteExpression LeftExpression
22 | {
23 | get { return _left; }
24 | set { _left = value; }
25 | }
26 |
27 | public bool IsBetween
28 | {
29 | get { return _between; }
30 | set { _between = value; }
31 | }
32 |
33 | public SQLiteExpression RightExpression
34 | {
35 | get { return _right; }
36 | set { _right = value; }
37 | }
38 |
39 | public SQLiteExpression AndExpression
40 | {
41 | get { return _and; }
42 | set { _and = value; }
43 | }
44 |
45 | public override bool IsConstant(bool allowNull)
46 | {
47 | return false;
48 | }
49 |
50 | public override bool Equals(object obj)
51 | {
52 | if (obj == null)
53 | return false;
54 |
55 | SQLiteBetweenExpression dst = obj as SQLiteBetweenExpression;
56 | if (dst == null)
57 | return false;
58 |
59 | if (this._between != dst._between)
60 | return false;
61 |
62 | if (!RefCompare.CompareMany(_left, dst._left, _right, dst._right, _and, dst._and))
63 | return false;
64 |
65 | return base.Equals(obj);
66 | }
67 |
68 | public override string ToString()
69 | {
70 | string res = _left.ToString() + " BETWEEN " + _right.ToString() + " AND " + _and.ToString();
71 | return res;
72 | }
73 |
74 | public override object Clone()
75 | {
76 | SQLiteExpression left = null;
77 | if (_left != null)
78 | left = (SQLiteExpression)_left.Clone();
79 | SQLiteExpression right = null;
80 | if (_right != null)
81 | right = (SQLiteExpression)_right.Clone();
82 | SQLiteExpression and = null;
83 | if (_and != null)
84 | and = (SQLiteExpression)_and.Clone();
85 |
86 | SQLiteBetweenExpression res = new SQLiteBetweenExpression();
87 | res._and = and;
88 | res._between = _between;
89 | res._left = left;
90 | res._right = right;
91 | return res;
92 | }
93 |
94 | private SQLiteExpression _left;
95 | private bool _between;
96 | private SQLiteExpression _right;
97 | private SQLiteExpression _and;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCaseItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCaseItem
8 | {
9 | private SQLiteCaseItem()
10 | {
11 | }
12 |
13 | public SQLiteCaseItem(SQLiteExpression whenExpr, SQLiteExpression thenExpr)
14 | {
15 | _when = whenExpr;
16 | _then = thenExpr;
17 | }
18 |
19 | public SQLiteExpression WhenExpression
20 | {
21 | get { return _when; }
22 | set { _when = value; }
23 | }
24 |
25 | public SQLiteExpression ThenExpression
26 | {
27 | get { return _then; }
28 | set { _then = value; }
29 | }
30 |
31 | public override bool Equals(object obj)
32 | {
33 | if (obj == null)
34 | return false;
35 |
36 | SQLiteCaseItem dst = obj as SQLiteCaseItem;
37 | if (dst == null)
38 | return false;
39 |
40 | if (!RefCompare.CompareMany(_when, dst._when, _then, dst._then))
41 | return false;
42 |
43 | return base.Equals(obj);
44 | }
45 |
46 | public override string ToString()
47 | {
48 | return "WHEN " + _when.ToString() + " THEN " + _then.ToString();
49 | }
50 |
51 | public virtual object Clone()
52 | {
53 | SQLiteExpression when = null;
54 | if (_when != null)
55 | when = (SQLiteExpression)_when.Clone();
56 | SQLiteExpression then = null;
57 | if (_then != null)
58 | then = (SQLiteExpression)_then.Clone();
59 |
60 | SQLiteCaseItem res = new SQLiteCaseItem();
61 | res._when = when;
62 | res._then = then;
63 | return res;
64 | }
65 |
66 | private SQLiteExpression _when;
67 | private SQLiteExpression _then;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCastExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCastExpression : SQLiteExpression
8 | {
9 | private SQLiteCastExpression()
10 | {
11 | }
12 |
13 | public SQLiteCastExpression(SQLiteExpression expr, SQLiteColumnType type)
14 | {
15 | _expr = expr;
16 | _type = type;
17 | }
18 |
19 | public SQLiteExpression Expression
20 | {
21 | get { return _expr; }
22 | set { _expr = value; }
23 | }
24 |
25 | public SQLiteColumnType CastType
26 | {
27 | get { return _type; }
28 | set { _type = value; }
29 | }
30 |
31 | public override bool IsConstant(bool allowNull)
32 | {
33 | return _expr.IsConstant(allowNull);
34 | }
35 |
36 | public override bool Equals(object obj)
37 | {
38 | if (obj == null)
39 | return false;
40 |
41 | SQLiteCastExpression dst = obj as SQLiteCastExpression;
42 | if (dst == null)
43 | return false;
44 |
45 | if (!RefCompare.CompareMany(_expr, dst._expr, _type, dst._type))
46 | return false;
47 |
48 | return base.Equals(obj);
49 | }
50 |
51 | public override string ToString()
52 | {
53 | string res = "CAST (" + _expr.ToString() + " AS " + _type.ToString() + ")";
54 | return res;
55 | }
56 |
57 | public override object Clone()
58 | {
59 | SQLiteExpression expr = null;
60 | if (_expr != null)
61 | expr = (SQLiteExpression)_expr.Clone();
62 | SQLiteColumnType type = null;
63 | if (_type != null)
64 | type = (SQLiteColumnType)_type.Clone();
65 |
66 | SQLiteCastExpression res = new SQLiteCastExpression();
67 | res._expr = expr;
68 | res._type = type;
69 | return res;
70 | }
71 |
72 | private SQLiteExpression _expr;
73 | private SQLiteColumnType _type;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCheckColumnConstraint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCheckColumnConstraint : SQLiteColumnConstraint
8 | {
9 | private SQLiteCheckColumnConstraint(string name)
10 | : base(name)
11 | {
12 | }
13 |
14 | public SQLiteCheckColumnConstraint(string name, SQLiteExpression expr)
15 | : base(name)
16 | {
17 | _expr = expr;
18 | }
19 |
20 | public SQLiteExpression Expression
21 | {
22 | get { return _expr; }
23 | set { _expr = value; }
24 | }
25 |
26 | public override bool Equals(object obj)
27 | {
28 | if (obj == null)
29 | return false;
30 |
31 | SQLiteCheckColumnConstraint dst = obj as SQLiteCheckColumnConstraint;
32 | if (dst == null)
33 | return false;
34 |
35 | if (!this.Expression.Equals(dst.Expression))
36 | return false;
37 |
38 | return base.Equals(obj);
39 | }
40 |
41 | public override string ToString()
42 | {
43 | if (this.ConstraintName != null)
44 | return "CONSTRAINT " + this.ConstraintName + " CHECK (" + _expr.ToString() + ")";
45 | else
46 | return "CHECK (" + _expr.ToString() + ")";
47 | }
48 |
49 | public override object Clone()
50 | {
51 | SQLiteExpression expr = null;
52 | if (_expr != null)
53 | expr = (SQLiteExpression)_expr.Clone();
54 |
55 | SQLiteCheckColumnConstraint res = new SQLiteCheckColumnConstraint(this.ConstraintName);
56 | res._expr = expr;
57 | return res;
58 | }
59 |
60 | private SQLiteExpression _expr;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCheckTableConstraint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCheckTableConstraint : SQLiteTableConstraint
8 | {
9 | private SQLiteCheckTableConstraint(string name)
10 | : base(name)
11 | {
12 | }
13 |
14 | public SQLiteCheckTableConstraint(string name, SQLiteExpression expr, SQLiteResolveAction conf)
15 | : base(name)
16 | {
17 | _expr = expr;
18 | _conf = conf;
19 | }
20 |
21 | public SQLiteExpression Expression
22 | {
23 | get { return _expr; }
24 | set { _expr = value; }
25 | }
26 |
27 | public SQLiteResolveAction ResolveAction
28 | {
29 | get { return _conf; }
30 | set { _conf = value; }
31 | }
32 |
33 | public override bool Equals(object obj)
34 | {
35 | if (obj == null)
36 | return false;
37 |
38 | SQLiteCheckTableConstraint dst = obj as SQLiteCheckTableConstraint;
39 | if (dst == null)
40 | return false;
41 |
42 | if (!RefCompare.CompareMany(_expr, dst._expr, _conf, dst._conf))
43 | return false;
44 |
45 | return base.Equals(obj);
46 | }
47 |
48 | public override string ToString()
49 | {
50 | StringBuilder sb = new StringBuilder();
51 | if (ConstraintName != null)
52 | sb.Append("CONSTRAINT " + ConstraintName+ " ");
53 | sb.Append("CHECK (" + _expr.ToString() + ")");
54 | if (_conf != SQLiteResolveAction.None)
55 | sb.Append(" " + Utils.GetConflictClauseString(_conf));
56 | return sb.ToString();
57 | }
58 |
59 | public override object Clone()
60 | {
61 | SQLiteExpression expr = null;
62 | if (_expr != null)
63 | expr = (SQLiteExpression)_expr.Clone();
64 |
65 | SQLiteCheckTableConstraint res = new SQLiteCheckTableConstraint(this.ConstraintName);
66 | res._expr = expr;
67 | res._conf = _conf;
68 | return res;
69 | }
70 |
71 | private SQLiteExpression _expr;
72 | private SQLiteResolveAction _conf;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCollateColumnConstraint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCollateColumnConstraint : SQLiteColumnConstraint
8 | {
9 | private SQLiteCollateColumnConstraint(string name)
10 | : base(name)
11 | {
12 | }
13 |
14 | public SQLiteCollateColumnConstraint(string name, string collation)
15 | : base(name)
16 | {
17 | CollationName = collation;
18 | }
19 |
20 | public string CollationName
21 | {
22 | get { return _collation; }
23 | set
24 | {
25 | _collation = Utils.QuoteIfNeeded(value);
26 | }
27 | }
28 |
29 | public override bool Equals(object obj)
30 | {
31 | if (obj == null)
32 | return false;
33 |
34 | SQLiteCollateColumnConstraint dst = obj as SQLiteCollateColumnConstraint;
35 | if (dst == null)
36 | return false;
37 |
38 | if (this.CollationName != dst.CollationName)
39 | return false;
40 |
41 | return base.Equals(obj);
42 | }
43 |
44 | public override string ToString()
45 | {
46 | if (ConstraintName != null)
47 | return "CONSTRAINT " + ConstraintName + " COLLATE " + _collation;
48 | else
49 | return "COLLATE " + _collation;
50 | }
51 |
52 | public override object Clone()
53 | {
54 | SQLiteCollateColumnConstraint res = new SQLiteCollateColumnConstraint(this.ConstraintName);
55 | res._collation = _collation;
56 | return res;
57 | }
58 |
59 | private string _collation;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCollateExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | class SQLiteCollateExpression : SQLiteExpression
8 | {
9 | private SQLiteCollateExpression()
10 | {
11 | }
12 |
13 | public SQLiteCollateExpression(SQLiteExpression expr, string collationName)
14 | {
15 | _expr = expr;
16 | CollationName = collationName;
17 | }
18 |
19 | public SQLiteExpression Expression
20 | {
21 | get { return _expr; }
22 | set { _expr = value; }
23 | }
24 |
25 | public string CollationName
26 | {
27 | get { return _collationName; }
28 | set
29 | {
30 | _collationName = Utils.QuoteIfNeeded(value);
31 | }
32 | }
33 |
34 | public override bool IsConstant(bool allowNull)
35 | {
36 | return false;
37 | }
38 |
39 | public override bool Equals(object obj)
40 | {
41 | if (obj == null)
42 | return false;
43 |
44 | SQLiteCollateExpression dst = obj as SQLiteCollateExpression;
45 | if (dst == null)
46 | return false;
47 |
48 | if (!RefCompare.Compare(_expr, dst._expr))
49 | return false;
50 |
51 | if (_collationName != dst._collationName)
52 | return false;
53 |
54 | return base.Equals(obj);
55 | }
56 |
57 | public override string ToString()
58 | {
59 | string res = _expr.ToString() + " COLLATE " + _collationName;
60 | return res;
61 | }
62 |
63 | public override object Clone()
64 | {
65 | SQLiteExpression expr = null;
66 | if (_expr != null)
67 | expr = (SQLiteExpression)_expr.Clone();
68 |
69 | SQLiteCollateExpression res = new SQLiteCollateExpression();
70 | res._expr = expr;
71 | res._collationName = _collationName;
72 | return res;
73 | }
74 |
75 | private SQLiteExpression _expr;
76 | private string _collationName;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteColumnConstraint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteColumnConstraint
8 | {
9 | public SQLiteColumnConstraint()
10 | {
11 | }
12 |
13 | public SQLiteColumnConstraint(string name)
14 | {
15 | ConstraintName = name;
16 | }
17 |
18 | public string ConstraintName
19 | {
20 | get { return _name; }
21 | set
22 | {
23 | _name = Utils.QuoteIfNeeded(value);
24 | }
25 | }
26 |
27 | public override bool Equals(object obj)
28 | {
29 | if (obj == null)
30 | return false;
31 |
32 | SQLiteColumnConstraint dst = obj as SQLiteColumnConstraint;
33 | if (dst == null)
34 | return false;
35 |
36 | return _name == dst._name;
37 | }
38 |
39 | public virtual object Clone()
40 | {
41 | SQLiteColumnConstraint res = new SQLiteColumnConstraint();
42 | res._name = _name;
43 | return res;
44 | }
45 |
46 | private string _name;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteColumnType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteColumnType
8 | {
9 | #region Constructors
10 | public SQLiteColumnType(string name, int size, int precision)
11 | {
12 | _name = Utils.QuoteIfNeeded(name);
13 | _size = size;
14 | _precision = precision;
15 | }
16 | #endregion
17 |
18 | #region Public Properties
19 | public string TypeName
20 | {
21 | get { return _name; }
22 | set { _name = Utils.QuoteIfNeeded(value); }
23 | }
24 |
25 | public int TypeSize
26 | {
27 | get { return _size; }
28 | set { _size = value; }
29 | }
30 |
31 | public int TypePrecision
32 | {
33 | get { return _precision; }
34 | set { _precision = value; }
35 | }
36 | #endregion
37 |
38 | #region Public Overrided Methods
39 | public override bool Equals(object obj)
40 | {
41 | if (obj == null)
42 | return false;
43 |
44 | SQLiteColumnType dst = obj as SQLiteColumnType;
45 | if (dst == null)
46 | return false;
47 |
48 | if (_name != dst._name || _size != dst._size || _precision != dst._precision)
49 | return false;
50 |
51 | return true;
52 | }
53 |
54 | public override string ToString()
55 | {
56 | StringBuilder sb = new StringBuilder();
57 | sb.Append(_name);
58 | if (_size > 0 && _precision > 0)
59 | sb.Append(string.Format("({0},{1})", _size, _precision));
60 | else if (_size > 0)
61 | sb.Append(string.Format("({0})", _size));
62 | return sb.ToString();
63 | }
64 | #endregion
65 |
66 | public virtual object Clone()
67 | {
68 | return new SQLiteColumnType(_name, _size, _precision);
69 | }
70 |
71 | #region Private Variables
72 | private string _name;
73 | private int _size;
74 | private int _precision;
75 | #endregion
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteCreateViewStatement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteCreateViewStatement : SQLiteDdlStatement
8 | {
9 | private SQLiteCreateViewStatement(SQLiteObjectName viewName)
10 | : base(viewName)
11 | {
12 | }
13 |
14 | public SQLiteCreateViewStatement(bool isTemp, bool ifNotExists, SQLiteObjectName viewName, SQLiteSelectStatement select)
15 | : base(viewName)
16 | {
17 | _isTemp = isTemp;
18 | _ifNotExists = ifNotExists;
19 | _select = select;
20 | }
21 |
22 | public bool IsTemp
23 | {
24 | get { return _isTemp; }
25 | set { _isTemp = value; }
26 | }
27 |
28 | public bool IfNotExists
29 | {
30 | get { return _ifNotExists; }
31 | set { _ifNotExists = value; }
32 | }
33 |
34 | public SQLiteSelectStatement SelectStatement
35 | {
36 | get { return _select; }
37 | set { _select = value; }
38 | }
39 |
40 | public override bool Equals(object obj)
41 | {
42 | if (obj == null)
43 | return false;
44 |
45 | SQLiteCreateViewStatement dst = obj as SQLiteCreateViewStatement;
46 | if (dst == null)
47 | return false;
48 |
49 | if (_isTemp != dst._isTemp || _ifNotExists != dst._ifNotExists)
50 | return false;
51 |
52 | if (!RefCompare.Compare(_select, dst._select))
53 | return false;
54 |
55 | return base.Equals(obj);
56 | }
57 |
58 | public override string ToString()
59 | {
60 | // CREATE temp VIEW ifnotexists nm dbnm AS select
61 |
62 | StringBuilder sb = new StringBuilder();
63 | sb.Append("CREATE");
64 | if (_isTemp)
65 | sb.Append(" TEMP");
66 | sb.Append(" VIEW");
67 | if (_ifNotExists)
68 | sb.Append(" IF NOT EXISTS");
69 | sb.Append(" " + base.ObjectName.ToString() + "\r\nAS\r\n" + _select.ToString());
70 |
71 | return sb.ToString();
72 | }
73 |
74 | public override object Clone()
75 | {
76 | SQLiteSelectStatement select = null;
77 | if (_select != null)
78 | select = (SQLiteSelectStatement)_select.Clone();
79 | SQLiteObjectName viewName = null;
80 | if (this.ObjectName != null)
81 | viewName = (SQLiteObjectName)this.ObjectName.Clone();
82 |
83 | SQLiteCreateViewStatement res = new SQLiteCreateViewStatement(viewName);
84 | res._ifNotExists = _ifNotExists;
85 | res._isTemp = _isTemp;
86 | res._select = select;
87 | return res;
88 | }
89 |
90 | private bool _isTemp;
91 | private bool _ifNotExists;
92 | private SQLiteSelectStatement _select;
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteDdlMain.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteDdlMain
8 | {
9 | public static SQLiteDdlStatement GetStatement()
10 | {
11 | if (CreateTable != null)
12 | return _createTable;
13 | if (CreateIndex != null)
14 | return _createIndex;
15 | if (CreateView != null)
16 | return _createView;
17 | if (CreateTrigger != null)
18 | return _createTrigger;
19 | throw new ApplicationException("no sql statement was found");
20 | }
21 |
22 | public static SQLiteCreateTableStatement CreateTable
23 | {
24 | get { return _createTable; }
25 | set
26 | {
27 | _createTable = value;
28 | _createView = null;
29 | _createTrigger = null;
30 | _createIndex = null;
31 | }
32 | }
33 |
34 | public static SQLiteCreateIndexStatement CreateIndex
35 | {
36 | get { return _createIndex; }
37 | set
38 | {
39 | _createIndex = value;
40 | _createView = null;
41 | _createTrigger = null;
42 | _createTable = null;
43 | }
44 | }
45 |
46 | public static SQLiteCreateViewStatement CreateView
47 | {
48 | get { return _createView; }
49 | set
50 | {
51 | _createView = value;
52 | _createTable = null;
53 | _createTrigger = null;
54 | _createIndex = null;
55 | }
56 | }
57 |
58 | public static SQLiteCreateTriggerStatement CreateTrigger
59 | {
60 | get { return _createTrigger; }
61 | set
62 | {
63 | _createTrigger = value;
64 | _createTable = null;
65 | _createIndex = null;
66 | _createView = null;
67 | }
68 | }
69 |
70 | private static SQLiteCreateIndexStatement _createIndex;
71 | private static SQLiteCreateTableStatement _createTable;
72 | private static SQLiteCreateTriggerStatement _createTrigger;
73 | private static SQLiteCreateViewStatement _createView;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteDdlStatement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | ///
8 | /// Serves as the base class for all SQL DDL statements
9 | ///
10 | public class SQLiteDdlStatement : SQLiteStatement
11 | {
12 | #region Constructors
13 | public SQLiteDdlStatement()
14 | {
15 | }
16 |
17 | public SQLiteDdlStatement(SQLiteObjectName name)
18 | {
19 | _objectName = name;
20 | }
21 | #endregion
22 |
23 | #region Public Properties
24 | ///
25 | /// Get/Set the name of the SQL object
26 | ///
27 | public SQLiteObjectName ObjectName
28 | {
29 | get { return _objectName; }
30 | set { _objectName = value; }
31 | }
32 | #endregion
33 |
34 | #region Public Overrided Methods
35 | public override bool Equals(object obj)
36 | {
37 | if (obj == null)
38 | return false;
39 |
40 | SQLiteDdlStatement dst = obj as SQLiteDdlStatement;
41 | if (dst == null)
42 | return false;
43 |
44 | return RefCompare.Compare(_objectName, dst._objectName);
45 | }
46 |
47 | public override object Clone()
48 | {
49 | SQLiteObjectName objectName = null;
50 | if (_objectName != null)
51 | objectName = (SQLiteObjectName)_objectName.Clone();
52 |
53 | SQLiteDdlStatement res = new SQLiteDdlStatement();
54 | res._objectName = objectName;
55 | return res;
56 | }
57 | #endregion
58 |
59 | #region Private Variables
60 | private SQLiteObjectName _objectName;
61 | #endregion
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteDeferColumnConstraint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteDeferColumnConstraint : SQLiteColumnConstraint
8 | {
9 | private SQLiteDeferColumnConstraint(string name)
10 | : base(name)
11 | {
12 | }
13 |
14 | public SQLiteDeferColumnConstraint(string name, bool deferrable, SQLiteDeferType deferType)
15 | : base(name)
16 | {
17 | _deferType = deferType;
18 | _deferrable = deferrable;
19 | }
20 |
21 | public bool IsDeferrable
22 | {
23 | get { return _deferrable; }
24 | set { _deferrable = value; }
25 | }
26 |
27 | public SQLiteDeferType DeferType
28 | {
29 | get { return _deferType; }
30 | set { _deferType = value; }
31 | }
32 |
33 | public override bool Equals(object obj)
34 | {
35 | if (obj == null)
36 | return false;
37 |
38 | SQLiteDeferColumnConstraint dst = obj as SQLiteDeferColumnConstraint;
39 | if (dst == null)
40 | return false;
41 |
42 | if (this._deferrable != dst._deferrable)
43 | return false;
44 | if (this._deferType != dst._deferType)
45 | return false;
46 |
47 | return base.Equals(obj);
48 | }
49 |
50 | public override string ToString()
51 | {
52 | StringBuilder sb = new StringBuilder();
53 | if (_deferrable)
54 | sb.Append("DEFERRABLE");
55 | else
56 | sb.Append("NOT DEFERRABLE");
57 | if (_deferType == SQLiteDeferType.InitiallyDeferred)
58 | sb.Append(" INITIALLY DEFERRED");
59 | else if (_deferType == SQLiteDeferType.InitiallyImmediate)
60 | sb.Append(" INITIALLY IMMEDIATE");
61 | return sb.ToString();
62 | }
63 |
64 | public override object Clone()
65 | {
66 | SQLiteDeferColumnConstraint res = new SQLiteDeferColumnConstraint(this.ConstraintName);
67 | res._deferType = _deferType;
68 | res._deferrable = _deferrable;
69 | return res;
70 | }
71 |
72 | private bool _deferrable;
73 | private SQLiteDeferType _deferType;
74 | }
75 |
76 | public enum SQLiteDeferType
77 | {
78 | None = 0,
79 |
80 | InitiallyDeferred = 1,
81 |
82 | InitiallyImmediate = 2,
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteDeleteStatement.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteDeleteStatement : SQLiteStatement
8 | {
9 | private SQLiteDeleteStatement()
10 | {
11 | }
12 |
13 | public SQLiteDeleteStatement(string table, SQLiteExpression whereExpr)
14 | {
15 | TableName = table;
16 | _whereExpr = whereExpr;
17 | }
18 |
19 | public string TableName
20 | {
21 | get { return _table; }
22 | set
23 | {
24 | _table = Utils.QuoteIfNeeded(value);
25 | }
26 | }
27 |
28 | public SQLiteExpression WhereExpression
29 | {
30 | get { return _whereExpr; }
31 | set { _whereExpr = value; }
32 | }
33 |
34 | public override bool Equals(object obj)
35 | {
36 | if (obj == null)
37 | return false;
38 |
39 | SQLiteDeleteStatement dst = obj as SQLiteDeleteStatement;
40 | if (dst == null)
41 | return false;
42 |
43 | if (_table != dst._table)
44 | return false;
45 | if (!RefCompare.Compare(_whereExpr, dst._whereExpr))
46 | return false;
47 |
48 | return base.Equals(obj);
49 | }
50 |
51 | public override string ToString()
52 | {
53 | StringBuilder sb = new StringBuilder();
54 | sb.Append("DELETE FROM " + _table);
55 | if (_whereExpr != null)
56 | sb.Append("\r\n WHERE " + _whereExpr.ToString());
57 | return sb.ToString();
58 | }
59 |
60 | public override object Clone()
61 | {
62 | SQLiteExpression whereExpr = null;
63 | if (_whereExpr != null)
64 | whereExpr = (SQLiteExpression)_whereExpr.Clone();
65 |
66 | SQLiteDeleteStatement res = new SQLiteDeleteStatement();
67 | res._table = _table;
68 | res._whereExpr = whereExpr;
69 | return res;
70 | }
71 |
72 | private string _table;
73 | private SQLiteExpression _whereExpr;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteDistinct.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public enum SQLiteDistinct
8 | {
9 | None = 0,
10 |
11 | Distinct = 1,
12 |
13 | All = 2,
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteExistsExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteExistsExpression : SQLiteExpression
8 | {
9 | private SQLiteExistsExpression()
10 | {
11 | }
12 |
13 | public SQLiteExistsExpression(SQLiteSelectStatement select)
14 | {
15 | _select = select;
16 | }
17 |
18 | public SQLiteSelectStatement SelectStatement
19 | {
20 | get { return _select; }
21 | set { _select = value; }
22 | }
23 |
24 | public override bool IsConstant(bool allowNull)
25 | {
26 | return false;
27 | }
28 |
29 | public override bool Equals(object obj)
30 | {
31 | if (obj == null)
32 | return false;
33 |
34 | SQLiteExistsExpression dst = obj as SQLiteExistsExpression;
35 | if (dst == null)
36 | return false;
37 |
38 | if (!RefCompare.Compare(_select, dst._select))
39 | return false;
40 |
41 | return base.Equals(obj);
42 | }
43 |
44 | public override string ToString()
45 | {
46 | string res = "EXISTS (" + _select.ToString() + ")";
47 | return res;
48 | }
49 |
50 | public override object Clone()
51 | {
52 | SQLiteSelectStatement select = null;
53 | if (_select != null)
54 | select = (SQLiteSelectStatement)_select.Clone();
55 |
56 | SQLiteExistsExpression res = new SQLiteExistsExpression();
57 | res._select = select;
58 | return res;
59 | }
60 |
61 | private SQLiteSelectStatement _select;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteExpression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteExpression
8 | {
9 | public override bool Equals(object obj)
10 | {
11 | if (obj == null)
12 | return false;
13 |
14 | SQLiteExpression dst = obj as SQLiteExpression;
15 | if (dst == null)
16 | return false;
17 | return true;
18 | }
19 |
20 | public override string ToString()
21 | {
22 | throw new InvalidOperationException("SQL statement rendering has failed");
23 | }
24 |
25 | public virtual object Clone()
26 | {
27 | throw new InvalidOperationException("SQL statement cloning has failed");
28 | }
29 |
30 | public virtual bool IsConstant(bool allowNull)
31 | {
32 | throw new NotSupportedException("IsConstant is not supported in the base class");
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SQLiteParser/SQLiteFromClause.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace SQLiteParser
6 | {
7 | public class SQLiteFromClause
8 | {
9 | public SQLiteFromClause AddJoin(SQLiteJoinOperator join)
10 | {
11 | _tables.Add(join);
12 | return this;
13 | }
14 |
15 | public SQLiteFromClause AddTable(SQLiteObjectName tableName, string asName,
16 | SQLiteFromIndexed indexed, SQLiteExpression onExpr, List usingOpt)
17 | {
18 | _tables.Add(new SQLiteFromTable(tableName, asName, indexed, onExpr, usingOpt));
19 | return this;
20 | }
21 |
22 | public SQLiteFromClause AddInternalTable(SQLiteFromInternalTable itable, string asName,
23 | SQLiteExpression onExpr, List usingOpt)
24 | {
25 | _tables.Add(new SQLiteFromTable(itable, asName, onExpr, usingOpt));
26 | return this;
27 | }
28 |
29 | public List