System.Data.SQLite

Check-in [4aaa3c5cf6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:no message
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 4aaa3c5cf6e30430b0db740f32887310a00d585a
User & Date: rmsimpson 2006-02-15 05:40:12.000
Context
2006-02-17
06:06
More index tweaks -- not done yet. check-in: cb20e39503 user: rmsimpson tags: sourceforge
2006-02-15
05:40
no message check-in: 4aaa3c5cf6 user: rmsimpson tags: sourceforge
2006-02-14
19:47
no message check-in: a1b56192e5 user: rmsimpson tags: sourceforge
Changes
Side-by-Side Diff Ignore Whitespace Patch
Added SQLite.Designer/CtcComponents/Guids.h.























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
//****************************************************************************
//
//    Copyright (c) Microsoft Corporation. All rights reserved.
//    This code is licensed under the Visual Studio SDK license terms.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//****************************************************************************

//
// This file is used to define the Guids used to identify the command groups
// created by the sample.
//

// {DCBE6C8D-0E57-4099-A183-98FF74C64D9C}
#define guidVSPackageBasedProviderPkg { 0xdcbe6c8d, 0x0e57, 0x4099, { 0xa1, 0x83, 0x98, 0xff, 0x74, 0xc6, 0x4d, 0x9c } }

#define Group_Undefined { 0x83285929, 0x227c, 0x11d3, { 0xb8, 0x70, 0x0, 0xc0, 0x4f, 0x79, 0xf8, 0x2 } }

// {814658EE-A28E-4b97-BC33-4B1BC81EBECB}
#define guidVSPackageBasedProviderCmdSet { 0x814658ee, 0xa28e, 0x4b97, { 0xbc, 0x33, 0x4b, 0x1b, 0xc8, 0x1e, 0xbe, 0xcb } }
Added SQLite.Designer/CtcComponents/PkgCmd.ctc.













































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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
//****************************************************************************
//
//    Copyright (c) Microsoft Corporation. All rights reserved.
//    This code is licensed under the Visual Studio SDK license terms.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//****************************************************************************

//
// This is the file that defines the actual layout and type of the commands.
// It is divided in different sections (e.g. command definition, command
// placement, ...), with each defining a specific set of properties.
//

#include "stdidcmd.h"
#include "vsshlids.h"
#include "msobtnid.h"
#include "Guids.h"
#include "PkgCmdID.h"

#define DIS_DEF DEFAULTDISABLED | DEFAULTINVISIBLE | DYNAMICVISIBILITY
#define OI_NOID guidOfficeIcon:msotcidNoIcon

CMDS_SECTION guidVSPackageBasedProviderPkg

    BUTTONS_BEGIN

        guidVSPackageBasedProviderCmdSet:cmdidCreateTable, Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Create Table";
        guidVSPackageBasedProviderCmdSet:cmdidAlterTable,  Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Alter Table";
        guidVSPackageBasedProviderCmdSet:cmdidDropTable,   Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Drop Table";

    BUTTONS_END

CMDS_END

CMDPLACEMENT_SECTION

    guidVSPackageBasedProviderCmdSet:cmdidCreateTable, guidVSData:IDG_DV_STATIC, 0x0100;
    guidVSPackageBasedProviderCmdSet:cmdidAlterTable,  guidVSData:IDG_DV_OBJECT, 0x0100;
    guidVSPackageBasedProviderCmdSet:cmdidDropTable,   guidVSData:IDG_DV_OBJECT, 0x0100;

CMDPLACEMENT_END
Added SQLite.Designer/CtcComponents/PkgCmdID.h.





















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
//****************************************************************************
//
//    Copyright (c) Microsoft Corporation. All rights reserved.
//    This code is licensed under the Visual Studio SDK license terms.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//****************************************************************************

//
// Definition of the numeric part of the IDs for the CTC elements of this
// package.
//

///////////////////////////////////////////////////////////////////////////////
// Commands
#define cmdidCreateTable 256
#define cmdidAlterTable  257
#define cmdidDropTable   258
Changes to SQLite.Designer/SQLite.Designer.csproj.
60
61
62
63
64
65
66

67
68
69
70
71
72
73
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74







+







    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="SQLiteCommandHandler.cs" />
    <Compile Include="SQLiteConnectionProperties.cs" />
    <Compile Include="SQLiteConnectionUIControl.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="SQLiteConnectionUIControl.Designer.cs">
      <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
    </Compile>
97
98
99
100
101
102
103







104
105
106
107
108
109
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117







+
+
+
+
+
+
+






  <ItemGroup>
    <EmbeddedResource Include="SQLiteConnectionUIControl.resx">
      <SubType>Designer</SubType>
      <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="SQLiteDataObjectSupport.xml" />
  </ItemGroup>
  <ItemGroup>
    <CtcFile Include="CtcComponents\PkgCmd.ctc">
      <ResourceName>1000</ResourceName>
    </CtcFile>
    <None Include="CtcComponents\Guids.h" />
    <None Include="CtcComponents\PkgCmdID.h" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Properties\" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="C:\Program Files\Visual Studio 2005 SDK\2006.02\VisualStudioIntegration\Tools\Build\Microsoft.VsSDK.targets" />
</Project>
Added SQLite.Designer/SQLiteCommandHandler.cs.






































































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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
namespace SQLite.Designer
{
  using System;
  using Microsoft.VisualStudio.Data;
  using System.Windows.Forms.Design;

  internal sealed class SQLiteCommandHandler : DataViewCommandHandler
  {
    private static readonly Guid guidDataCmdSet = new Guid("501822E1-B5AF-11d0-B4DC-00A0C91506EF");
    private static readonly Guid guidSQLiteCmdSet = new Guid("814658EE-A28E-4b97-BC33-4B1BC81EBECB");
    private const int cmdidCreateTable = 256;

    public SQLiteCommandHandler()
    {
    }

    public override OleCommandStatus GetCommandStatus(int[] itemIds, OleCommand command, OleCommandTextType textType, OleCommandStatus status)
    {
      if (command.GroupGuid == guidSQLiteCmdSet)
      {
        switch (command.CommandId)
        {
          case cmdidCreateTable:
            status.Supported = true;
            status.Visible = true;
            status.Enabled = true;
            break;
          default:
            base.GetCommandStatus(itemIds, command, textType, status);
            break;
        }
      }
      else
      {
        base.GetCommandStatus(itemIds, command, textType, status);
      }
      return status;
    }

    /// <summary>
    /// This method executes a specified command, potentially based
    /// on parameters passed in from the data view support XML.
    /// </summary>
    public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments)
    {
      object returnValue = null;
      if (command.GroupGuid == guidSQLiteCmdSet)
      {
        switch (command.CommandId)
        {
          case cmdidCreateTable:
            CreateTable();
            break;
          default:
            returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments);
            break;
        }
      }
      else
      {
        returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments);
      }
      return returnValue;
    }

    private void CreateTable()
    {
    }
  }
}
Changes to SQLite.Designer/SQLiteDataViewSupport.xml.
20
21
22
23
24
25
26
27

28
29
30
31
32

33
34
35
36
37
38
39
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40







-
+





+







				<InitialDisplayName>{Root.Server}</InitialDisplayName>
				<CommandBindings>
					<!--
						This command binding hooks up a command that launches the built-
						in Visual Studio query designer.
					-->
					<CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
				</CommandBindings>
        </CommandBindings>
				<Children>
					<StaticNode nid="Tables">
            <DisplayName>User Tables</DisplayName>
						<CommandBindings>
							<CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
              <CommandBinding name="NewTable" guid="814658EE-A28E-4b97-BC33-4B1BC81EBECB" cmdid="256" handler="SQLite.Designer.SQLiteCommandHandler"/>
            </CommandBindings>
						<Children>
							<!--
								To show a set of objects from the data source we issue a
								selection, specifying type, restrictions and filter.
							-->
							<Selection type="Table" restrictions="null,null,null,TABLE">
Changes to SQLite.Designer/VSPackage.Designer.cs.
55
56
57
58
59
60
61









62
63
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72







+
+
+
+
+
+
+
+
+


            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        ///   Looks up a localized string similar to MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC.
        /// </summary>
        internal static string _400 {
            get {
                return ResourceManager.GetString("400", resourceCulture);
            }
        }
    }
}
Changes to SQLite.Designer/VSPackage.resx.
113
114
115
116
117
118
119



120
113
114
115
116
117
118
119
120
121
122
123







+
+
+

  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="400" xml:space="preserve">
    <value>MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC</value>
  </data>
</root>
Changes to tools/install/InstallDesigner.cs.
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
43
44
45

46

47
48
49
50
51
52
53
54
55
56

57

58
59
60
61
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
56
57
58
59

60
61
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







+











+
-
+










+
-
+










+
-
+

















+







    private static Guid jetDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC3}");
    private static Guid jetAltDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC4}");
    private static string[] compactFrameworks = new string[] { "PocketPC", "SmartPhone", "WindowsCE" };

    private string _regRoot = "8.0";
    private System.Reflection.Assembly _assm = null;
    private bool _ignoreChecks = true;
    private string _assmLocation;

    System.Reflection.Assembly SQLite
    {
      get
      {
        if (_assm == null)
        {
          Environment.CurrentDirectory = Path.GetDirectoryName(typeof(InstallDesigner).Assembly.Location);

          try
          {
            _assmLocation = Path.GetFullPath("..\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom("..\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
          }
          catch
          {
          }
        }

        if (_assm == null)
        {
          try
          {
            _assmLocation = Path.GetFullPath("..\\x64\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom("..\\x64\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
          }
          catch
          {
          }
        }

        if (_assm == null)
        {
          try
          {
            _assmLocation = Path.GetFullPath("..\\itanium\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom("..\\itanium\\System.Data.SQLite.DLL");
            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
          }
          catch
          {
          }
        }

        OpenFileDialog dlg = new OpenFileDialog();
        while (_assm == null)
        {
          dlg.Multiselect = false;
          dlg.InitialDirectory = Environment.CurrentDirectory;
          dlg.FileName = "System.Data.SQLite.DLL";
          dlg.Filter = "System.Data.SQLite.DLL|System.Data.SQLite.DLL";
          if (dlg.ShowDialog() == DialogResult.OK)
          {
            try
            {
              _assmLocation = dlg.FileName;
              _assm = System.Reflection.Assembly.LoadFrom(dlg.FileName);
            }
            catch
            {
            }
          }
          else
227
228
229
230
231
232
233


234
235
236
237
238
239
240







241
242

243
244
245
246
247
248





249
250
251
252








253
254
255
256
257
258
259
232
233
234
235
236
237
238
239
240







241
242
243
244
245
246
247
248

249
250





251
252
253
254
255
256



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271







+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+

-
+

-
-
-
-
-
+
+
+
+
+

-
-
-
+
+
+
+
+
+
+
+







        if (installList.Items[n].Checked == true)
        {
          install = true;
          break;
        }
      }

      try
      {
      if (install && !installed)
      {
        AssemblyCache.InstallAssembly(SQLite.Location, null, AssemblyCommitFlags.Default);
      }
      else if (!install && installed)
      {
        AssemblyCacheUninstallDisposition disp;
        if (install && !installed)
        {
          AssemblyCache.InstallAssembly(_assmLocation, null, AssemblyCommitFlags.Default);
        }
        else if (!install && installed)
        {
          AssemblyCacheUninstallDisposition disp;

        AssemblyCacheEnum entries = new AssemblyCacheEnum("System.Data.SQLite");
          AssemblyCacheEnum entries = new AssemblyCacheEnum("System.Data.SQLite");

        string s;
        while (true)
        {
          s = entries.GetNextAssembly();
          if (String.IsNullOrEmpty(s)) break;
          string s;
          while (true)
          {
            s = entries.GetNextAssembly();
            if (String.IsNullOrEmpty(s)) break;

          AssemblyCache.UninstallAssembly(s, null, out disp);
        }
        SQLite = null;
            AssemblyCache.UninstallAssembly(s, null, out disp);
          }
          SQLite = null;
        }
      }
      catch
      {
        throw;
      }
    }

    private void ReplaceJet(string keyname)
    {
      using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\{1}\\DataProviders", keyname, _regRoot), true))
      {
380
381
382
383
384
385
386
387

388
389

390
391
392
393
394
395
396
397
398

399
400
401
402
403
404
405
392
393
394
395
396
397
398

399
400

401
402
403
404
405
406
407
408
409

410
411
412
413
414
415
416
417







-
+

-
+








-
+







              subkey.SetValue("InvariantName", "System.Data.SQLite");
              subkey.SetValue("RuntimeAssembly", "System.Data.SQLite.DLL");
            }
          }
        }
      }

      string path = Path.GetDirectoryName(SQLite.Location);
      string path = Path.GetDirectoryName(_assmLocation);

      while (path.Length > 0)
      while (String.IsNullOrEmpty(path) == false)
      {
        if (File.Exists(path + "\\CompactFramework\\System.Data.SQLite.DLL") == false)
        {
          path = Path.GetDirectoryName(path);
        }
        else break;
      }

      if (path.Length > 0)
      if (String.IsNullOrEmpty(path) == false)
      {
        path += "\\CompactFramework\\";

        for (int n = 0; n < compactFrameworks.Length; n++)
        {
          using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\AssemblyFoldersEx", compactFrameworks[n]), true))
          {
420
421
422
423
424
425
426
427

428
429
430
431

432
433
434
435
436
437
438
432
433
434
435
436
437
438

439
440
441
442

443
444
445
446
447
448
449
450







-
+



-
+







      using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Packages", keyname), true))
      {
        using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9C}", RegistryKeyPermissionCheck.ReadWriteSubTree))
        {
          subkey.SetValue(null, "SQLite Designer Package");
          subkey.SetValue("Class", "SQLite.Designer.SQLitePackage");
          subkey.SetValue("CodeBase", Path.GetFullPath("SQLite.Designer.DLL"));
          subkey.SetValue("ID", 1);
          subkey.SetValue("ID", 400);
          subkey.SetValue("InprocServer32", "mscoree.dll");
          subkey.SetValue("CompanyName", "Black Castle Software, LLC");
          subkey.SetValue("MinEdition", "standard");
          subkey.SetValue("ProductName", "SQLite Designer");
          subkey.SetValue("ProductName", "SQLite Data Provider");
          subkey.SetValue("ProductVersion", "1.0");
        }
      }

      using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Services", keyname), true))
      {
        using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9D}", RegistryKeyPermissionCheck.ReadWriteSubTree))
Changes to tools/install/install.csproj.
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25







-
+







    <AssemblyName>install</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\bin\designer\</OutputPath>
    <DefineConstants>TRACE;DEBUG;NUSEPACKAGE</DefineConstants>
    <DefineConstants>TRACE;DEBUG;USEPACKAGE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>