System.Data.SQLite
Check-in [4aaa3c5cf6]
Not logged in

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

Overview
Comment:no message
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 4aaa3c5cf6e30430b0db740f32887310a00d585a
User & Date: rmsimpson 2006-02-15 05:40:12
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
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added SQLite.Designer/CtcComponents/Guids.h.

            1  +//****************************************************************************
            2  +//
            3  +//    Copyright (c) Microsoft Corporation. All rights reserved.
            4  +//    This code is licensed under the Visual Studio SDK license terms.
            5  +//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
            6  +//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
            7  +//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
            8  +//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
            9  +//
           10  +//****************************************************************************
           11  +
           12  +//
           13  +// This file is used to define the Guids used to identify the command groups
           14  +// created by the sample.
           15  +//
           16  +
           17  +// {DCBE6C8D-0E57-4099-A183-98FF74C64D9C}
           18  +#define guidVSPackageBasedProviderPkg { 0xdcbe6c8d, 0x0e57, 0x4099, { 0xa1, 0x83, 0x98, 0xff, 0x74, 0xc6, 0x4d, 0x9c } }
           19  +
           20  +#define Group_Undefined { 0x83285929, 0x227c, 0x11d3, { 0xb8, 0x70, 0x0, 0xc0, 0x4f, 0x79, 0xf8, 0x2 } }
           21  +
           22  +// {814658EE-A28E-4b97-BC33-4B1BC81EBECB}
           23  +#define guidVSPackageBasedProviderCmdSet { 0x814658ee, 0xa28e, 0x4b97, { 0xbc, 0x33, 0x4b, 0x1b, 0xc8, 0x1e, 0xbe, 0xcb } }

Added SQLite.Designer/CtcComponents/PkgCmd.ctc.

            1  +//****************************************************************************
            2  +//
            3  +//    Copyright (c) Microsoft Corporation. All rights reserved.
            4  +//    This code is licensed under the Visual Studio SDK license terms.
            5  +//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
            6  +//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
            7  +//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
            8  +//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
            9  +//
           10  +//****************************************************************************
           11  +
           12  +//
           13  +// This is the file that defines the actual layout and type of the commands.
           14  +// It is divided in different sections (e.g. command definition, command
           15  +// placement, ...), with each defining a specific set of properties.
           16  +//
           17  +
           18  +#include "stdidcmd.h"
           19  +#include "vsshlids.h"
           20  +#include "msobtnid.h"
           21  +#include "Guids.h"
           22  +#include "PkgCmdID.h"
           23  +
           24  +#define DIS_DEF DEFAULTDISABLED | DEFAULTINVISIBLE | DYNAMICVISIBILITY
           25  +#define OI_NOID guidOfficeIcon:msotcidNoIcon
           26  +
           27  +CMDS_SECTION guidVSPackageBasedProviderPkg
           28  +
           29  +    BUTTONS_BEGIN
           30  +
           31  +        guidVSPackageBasedProviderCmdSet:cmdidCreateTable, Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Create Table";
           32  +        guidVSPackageBasedProviderCmdSet:cmdidAlterTable,  Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Alter Table";
           33  +        guidVSPackageBasedProviderCmdSet:cmdidDropTable,   Group_Undefined:0, 0x0000, OI_NOID, BUTTON, DIS_DEF, "&Drop Table";
           34  +
           35  +    BUTTONS_END
           36  +
           37  +CMDS_END
           38  +
           39  +CMDPLACEMENT_SECTION
           40  +
           41  +    guidVSPackageBasedProviderCmdSet:cmdidCreateTable, guidVSData:IDG_DV_STATIC, 0x0100;
           42  +    guidVSPackageBasedProviderCmdSet:cmdidAlterTable,  guidVSData:IDG_DV_OBJECT, 0x0100;
           43  +    guidVSPackageBasedProviderCmdSet:cmdidDropTable,   guidVSData:IDG_DV_OBJECT, 0x0100;
           44  +
           45  +CMDPLACEMENT_END

Added SQLite.Designer/CtcComponents/PkgCmdID.h.

            1  +//****************************************************************************
            2  +//
            3  +//    Copyright (c) Microsoft Corporation. All rights reserved.
            4  +//    This code is licensed under the Visual Studio SDK license terms.
            5  +//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
            6  +//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
            7  +//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
            8  +//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
            9  +//
           10  +//****************************************************************************
           11  +
           12  +//
           13  +// Definition of the numeric part of the IDs for the CTC elements of this
           14  +// package.
           15  +//
           16  +
           17  +///////////////////////////////////////////////////////////////////////////////
           18  +// Commands
           19  +#define cmdidCreateTable 256
           20  +#define cmdidAlterTable  257
           21  +#define cmdidDropTable   258

Changes to SQLite.Designer/SQLite.Designer.csproj.

    60     60       <Reference Include="System" />
    61     61       <Reference Include="System.Data" />
    62     62       <Reference Include="System.Drawing" />
    63     63       <Reference Include="System.Windows.Forms" />
    64     64       <Reference Include="System.Xml" />
    65     65     </ItemGroup>
    66     66     <ItemGroup>
           67  +    <Compile Include="SQLiteCommandHandler.cs" />
    67     68       <Compile Include="SQLiteConnectionProperties.cs" />
    68     69       <Compile Include="SQLiteConnectionUIControl.cs">
    69     70         <SubType>Form</SubType>
    70     71       </Compile>
    71     72       <Compile Include="SQLiteConnectionUIControl.Designer.cs">
    72     73         <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
    73     74       </Compile>
................................................................................
    97     98     <ItemGroup>
    98     99       <EmbeddedResource Include="SQLiteConnectionUIControl.resx">
    99    100         <SubType>Designer</SubType>
   100    101         <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
   101    102       </EmbeddedResource>
   102    103       <EmbeddedResource Include="SQLiteDataObjectSupport.xml" />
   103    104     </ItemGroup>
          105  +  <ItemGroup>
          106  +    <CtcFile Include="CtcComponents\PkgCmd.ctc">
          107  +      <ResourceName>1000</ResourceName>
          108  +    </CtcFile>
          109  +    <None Include="CtcComponents\Guids.h" />
          110  +    <None Include="CtcComponents\PkgCmdID.h" />
          111  +  </ItemGroup>
   104    112     <ItemGroup>
   105    113       <Folder Include="Properties\" />
   106    114     </ItemGroup>
   107    115     <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   108    116     <Import Project="C:\Program Files\Visual Studio 2005 SDK\2006.02\VisualStudioIntegration\Tools\Build\Microsoft.VsSDK.targets" />
   109    117   </Project>

Added SQLite.Designer/SQLiteCommandHandler.cs.

            1  +namespace SQLite.Designer
            2  +{
            3  +  using System;
            4  +  using Microsoft.VisualStudio.Data;
            5  +  using System.Windows.Forms.Design;
            6  +
            7  +  internal sealed class SQLiteCommandHandler : DataViewCommandHandler
            8  +  {
            9  +    private static readonly Guid guidDataCmdSet = new Guid("501822E1-B5AF-11d0-B4DC-00A0C91506EF");
           10  +    private static readonly Guid guidSQLiteCmdSet = new Guid("814658EE-A28E-4b97-BC33-4B1BC81EBECB");
           11  +    private const int cmdidCreateTable = 256;
           12  +
           13  +    public SQLiteCommandHandler()
           14  +    {
           15  +    }
           16  +
           17  +    public override OleCommandStatus GetCommandStatus(int[] itemIds, OleCommand command, OleCommandTextType textType, OleCommandStatus status)
           18  +    {
           19  +      if (command.GroupGuid == guidSQLiteCmdSet)
           20  +      {
           21  +        switch (command.CommandId)
           22  +        {
           23  +          case cmdidCreateTable:
           24  +            status.Supported = true;
           25  +            status.Visible = true;
           26  +            status.Enabled = true;
           27  +            break;
           28  +          default:
           29  +            base.GetCommandStatus(itemIds, command, textType, status);
           30  +            break;
           31  +        }
           32  +      }
           33  +      else
           34  +      {
           35  +        base.GetCommandStatus(itemIds, command, textType, status);
           36  +      }
           37  +      return status;
           38  +    }
           39  +
           40  +    /// <summary>
           41  +    /// This method executes a specified command, potentially based
           42  +    /// on parameters passed in from the data view support XML.
           43  +    /// </summary>
           44  +    public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments)
           45  +    {
           46  +      object returnValue = null;
           47  +      if (command.GroupGuid == guidSQLiteCmdSet)
           48  +      {
           49  +        switch (command.CommandId)
           50  +        {
           51  +          case cmdidCreateTable:
           52  +            CreateTable();
           53  +            break;
           54  +          default:
           55  +            returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments);
           56  +            break;
           57  +        }
           58  +      }
           59  +      else
           60  +      {
           61  +        returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments);
           62  +      }
           63  +      return returnValue;
           64  +    }
           65  +
           66  +    private void CreateTable()
           67  +    {
           68  +    }
           69  +  }
           70  +}

Changes to SQLite.Designer/SQLiteDataViewSupport.xml.

    20     20   				<InitialDisplayName>{Root.Server}</InitialDisplayName>
    21     21   				<CommandBindings>
    22     22   					<!--
    23     23   						This command binding hooks up a command that launches the built-
    24     24   						in Visual Studio query designer.
    25     25   					-->
    26     26   					<CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
    27         -				</CommandBindings>
           27  +        </CommandBindings>
    28     28   				<Children>
    29     29   					<StaticNode nid="Tables">
    30     30               <DisplayName>User Tables</DisplayName>
    31     31   						<CommandBindings>
    32     32   							<CommandBinding name="NewQuery" guid="501822E1-B5AF-11d0-B4DC-00A0C91506EF" cmdid="13608" handler="884DD964-5327-461f-9F06-6484DD540F8F"/>
           33  +              <CommandBinding name="NewTable" guid="814658EE-A28E-4b97-BC33-4B1BC81EBECB" cmdid="256" handler="SQLite.Designer.SQLiteCommandHandler"/>
    33     34               </CommandBindings>
    34     35   						<Children>
    35     36   							<!--
    36     37   								To show a set of objects from the data source we issue a
    37     38   								selection, specifying type, restrictions and filter.
    38     39   							-->
    39     40   							<Selection type="Table" restrictions="null,null,null,TABLE">

Changes to SQLite.Designer/VSPackage.Designer.cs.

    55     55               get {
    56     56                   return resourceCulture;
    57     57               }
    58     58               set {
    59     59                   resourceCulture = value;
    60     60               }
    61     61           }
           62  +        
           63  +        /// <summary>
           64  +        ///   Looks up a localized string similar to MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC.
           65  +        /// </summary>
           66  +        internal static string _400 {
           67  +            get {
           68  +                return ResourceManager.GetString("400", resourceCulture);
           69  +            }
           70  +        }
    62     71       }
    63     72   }

Changes to SQLite.Designer/VSPackage.resx.

   113    113     </resheader>
   114    114     <resheader name="reader">
   115    115       <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   116    116     </resheader>
   117    117     <resheader name="writer">
   118    118       <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   119    119     </resheader>
          120  +  <data name="400" xml:space="preserve">
          121  +    <value>MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC</value>
          122  +  </data>
   120    123   </root>

Changes to tools/install/InstallDesigner.cs.

    28     28       private static Guid jetDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC3}");
    29     29       private static Guid jetAltDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC4}");
    30     30       private static string[] compactFrameworks = new string[] { "PocketPC", "SmartPhone", "WindowsCE" };
    31     31   
    32     32       private string _regRoot = "8.0";
    33     33       private System.Reflection.Assembly _assm = null;
    34     34       private bool _ignoreChecks = true;
           35  +    private string _assmLocation;
    35     36   
    36     37       System.Reflection.Assembly SQLite
    37     38       {
    38     39         get
    39     40         {
    40     41           if (_assm == null)
    41     42           {
    42     43             Environment.CurrentDirectory = Path.GetDirectoryName(typeof(InstallDesigner).Assembly.Location);
    43     44   
    44     45             try
    45     46             {
    46         -            _assm = System.Reflection.Assembly.LoadFrom("..\\System.Data.SQLite.DLL");
           47  +            _assmLocation = Path.GetFullPath("..\\System.Data.SQLite.DLL");
           48  +            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
    47     49             }
    48     50             catch
    49     51             {
    50     52             }
    51     53           }
    52     54   
    53     55           if (_assm == null)
    54     56           {
    55     57             try
    56     58             {
    57         -            _assm = System.Reflection.Assembly.LoadFrom("..\\x64\\System.Data.SQLite.DLL");
           59  +            _assmLocation = Path.GetFullPath("..\\x64\\System.Data.SQLite.DLL");
           60  +            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
    58     61             }
    59     62             catch
    60     63             {
    61     64             }
    62     65           }
    63     66   
    64     67           if (_assm == null)
    65     68           {
    66     69             try
    67     70             {
    68         -            _assm = System.Reflection.Assembly.LoadFrom("..\\itanium\\System.Data.SQLite.DLL");
           71  +            _assmLocation = Path.GetFullPath("..\\itanium\\System.Data.SQLite.DLL");
           72  +            _assm = System.Reflection.Assembly.LoadFrom(_assmLocation);
    69     73             }
    70     74             catch
    71     75             {
    72     76             }
    73     77           }
    74     78   
    75     79           OpenFileDialog dlg = new OpenFileDialog();
................................................................................
    79     83             dlg.InitialDirectory = Environment.CurrentDirectory;
    80     84             dlg.FileName = "System.Data.SQLite.DLL";
    81     85             dlg.Filter = "System.Data.SQLite.DLL|System.Data.SQLite.DLL";
    82     86             if (dlg.ShowDialog() == DialogResult.OK)
    83     87             {
    84     88               try
    85     89               {
           90  +              _assmLocation = dlg.FileName;
    86     91                 _assm = System.Reflection.Assembly.LoadFrom(dlg.FileName);
    87     92               }
    88     93               catch
    89     94               {
    90     95               }
    91     96             }
    92     97             else
................................................................................
   227    232           if (installList.Items[n].Checked == true)
   228    233           {
   229    234             install = true;
   230    235             break;
   231    236           }
   232    237         }
   233    238   
   234         -      if (install && !installed)
   235         -      {
   236         -        AssemblyCache.InstallAssembly(SQLite.Location, null, AssemblyCommitFlags.Default);
   237         -      }
   238         -      else if (!install && installed)
   239         -      {
   240         -        AssemblyCacheUninstallDisposition disp;
   241         -
   242         -        AssemblyCacheEnum entries = new AssemblyCacheEnum("System.Data.SQLite");
   243         -
   244         -        string s;
   245         -        while (true)
   246         -        {
   247         -          s = entries.GetNextAssembly();
   248         -          if (String.IsNullOrEmpty(s)) break;
   249         -
   250         -          AssemblyCache.UninstallAssembly(s, null, out disp);
   251         -        }
   252         -        SQLite = null;
          239  +      try
          240  +      {
          241  +        if (install && !installed)
          242  +        {
          243  +          AssemblyCache.InstallAssembly(_assmLocation, null, AssemblyCommitFlags.Default);
          244  +        }
          245  +        else if (!install && installed)
          246  +        {
          247  +          AssemblyCacheUninstallDisposition disp;
          248  +
          249  +          AssemblyCacheEnum entries = new AssemblyCacheEnum("System.Data.SQLite");
          250  +
          251  +          string s;
          252  +          while (true)
          253  +          {
          254  +            s = entries.GetNextAssembly();
          255  +            if (String.IsNullOrEmpty(s)) break;
          256  +
          257  +            AssemblyCache.UninstallAssembly(s, null, out disp);
          258  +          }
          259  +          SQLite = null;
          260  +        }
          261  +      }
          262  +      catch
          263  +      {
          264  +        throw;
   253    265         }
   254    266       }
   255    267   
   256    268       private void ReplaceJet(string keyname)
   257    269       {
   258    270         using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\{1}\\DataProviders", keyname, _regRoot), true))
   259    271         {
................................................................................
   380    392                 subkey.SetValue("InvariantName", "System.Data.SQLite");
   381    393                 subkey.SetValue("RuntimeAssembly", "System.Data.SQLite.DLL");
   382    394               }
   383    395             }
   384    396           }
   385    397         }
   386    398   
   387         -      string path = Path.GetDirectoryName(SQLite.Location);
          399  +      string path = Path.GetDirectoryName(_assmLocation);
   388    400   
   389         -      while (path.Length > 0)
          401  +      while (String.IsNullOrEmpty(path) == false)
   390    402         {
   391    403           if (File.Exists(path + "\\CompactFramework\\System.Data.SQLite.DLL") == false)
   392    404           {
   393    405             path = Path.GetDirectoryName(path);
   394    406           }
   395    407           else break;
   396    408         }
   397    409   
   398         -      if (path.Length > 0)
          410  +      if (String.IsNullOrEmpty(path) == false)
   399    411         {
   400    412           path += "\\CompactFramework\\";
   401    413   
   402    414           for (int n = 0; n < compactFrameworks.Length; n++)
   403    415           {
   404    416             using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\AssemblyFoldersEx", compactFrameworks[n]), true))
   405    417             {
................................................................................
   420    432         using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Packages", keyname), true))
   421    433         {
   422    434           using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9C}", RegistryKeyPermissionCheck.ReadWriteSubTree))
   423    435           {
   424    436             subkey.SetValue(null, "SQLite Designer Package");
   425    437             subkey.SetValue("Class", "SQLite.Designer.SQLitePackage");
   426    438             subkey.SetValue("CodeBase", Path.GetFullPath("SQLite.Designer.DLL"));
   427         -          subkey.SetValue("ID", 1);
          439  +          subkey.SetValue("ID", 400);
   428    440             subkey.SetValue("InprocServer32", "mscoree.dll");
   429    441             subkey.SetValue("CompanyName", "Black Castle Software, LLC");
   430    442             subkey.SetValue("MinEdition", "standard");
   431         -          subkey.SetValue("ProductName", "SQLite Designer");
          443  +          subkey.SetValue("ProductName", "SQLite Data Provider");
   432    444             subkey.SetValue("ProductVersion", "1.0");
   433    445           }
   434    446         }
   435    447   
   436    448         using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Services", keyname), true))
   437    449         {
   438    450           using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9D}", RegistryKeyPermissionCheck.ReadWriteSubTree))

Changes to tools/install/install.csproj.

    11     11       <AssemblyName>install</AssemblyName>
    12     12     </PropertyGroup>
    13     13     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    14     14       <DebugSymbols>true</DebugSymbols>
    15     15       <DebugType>full</DebugType>
    16     16       <Optimize>false</Optimize>
    17     17       <OutputPath>..\..\bin\designer\</OutputPath>
    18         -    <DefineConstants>TRACE;DEBUG;NUSEPACKAGE</DefineConstants>
           18  +    <DefineConstants>TRACE;DEBUG;USEPACKAGE</DefineConstants>
    19     19       <ErrorReport>prompt</ErrorReport>
    20     20       <WarningLevel>4</WarningLevel>
    21     21       <PlatformTarget>x86</PlatformTarget>
    22     22     </PropertyGroup>
    23     23     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    24     24       <DebugType>none</DebugType>
    25     25       <Optimize>true</Optimize>