System.Data.SQLite
Check-in [1283114bab]
Not logged in

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

Overview
Comment:work in progress
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 1283114bab77736f4f5c3e862cec52e315f9c7aa
User & Date: rmsimpson 2006-02-24 06:07:09
Context
2006-02-24
23:26
work in progress check-in: 92a5b1ec00 user: rmsimpson tags: sourceforge
06:07
work in progress check-in: 1283114bab user: rmsimpson tags: sourceforge
02:58
no message check-in: aef54e6441 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
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
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\Designer\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1701;1702;1699</NoWarn>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
................................................................................
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <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>UserControl</SubType>
    </Compile>
    <Compile Include="SQLiteConnectionUIControl.Designer.cs">
      <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
    </Compile>

    <Compile Include="SQLiteDataConnectionSupport.cs" />
    <Compile Include="SQLiteDataObjectIdentifierResolver.cs" />
    <Compile Include="SQLiteDataObjectSupport.cs" />
    <Compile Include="SQLiteDataSourceInformation.cs" />
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="SQLiteDataViewSupport.cs" />
    <Compile Include="SQLitePackage.cs" />







|







 







>
>
>
>
>





>
>








>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
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
    <AssemblyOriginatorKeyFile>
    </AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1701;1702;1699</NoWarn>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
................................................................................
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Data.SQLite, Version=1.0.26.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <Private>False</Private>
    </Reference>
    <Reference Include="System.Design" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="SQLiteCommandDesigner.cs">
    </Compile>
    <Compile Include="SQLiteCommandHandler.cs" />
    <Compile Include="SQLiteConnectionProperties.cs" />
    <Compile Include="SQLiteConnectionUIControl.cs">
      <SubType>UserControl</SubType>
    </Compile>
    <Compile Include="SQLiteConnectionUIControl.Designer.cs">
      <DependentUpon>SQLiteConnectionUIControl.cs</DependentUpon>
    </Compile>
    <Compile Include="SQLiteDataAdapterToolboxItem.cs" />
    <Compile Include="SQLiteDataConnectionSupport.cs" />
    <Compile Include="SQLiteDataObjectIdentifierResolver.cs" />
    <Compile Include="SQLiteDataObjectSupport.cs" />
    <Compile Include="SQLiteDataSourceInformation.cs" />
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="SQLiteDataViewSupport.cs" />
    <Compile Include="SQLitePackage.cs" />

Added SQLite.Designer/SQLiteCommandDesigner.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
namespace SQLite.Designer
{
  using System;
  using System.ComponentModel;
  using System.ComponentModel.Design;
  using System.Data.Common;
  using System.Data;

  [ProvideProperty("CommandDesignTimeVisible", typeof(IDbCommand))]
  internal sealed class SQLiteCommandDesigner : ComponentDesigner, IExtenderProvider
  {
    private object _designer;
    private Type _designerType;
    private bool visible;

    public SQLiteCommandDesigner()
    {
      _designerType = SQLiteDataAdapterToolboxItem._vsdesigner.GetType("Microsoft.VSDesigner.Data.VS.DataCommandDesigner");
      _designer = Activator.CreateInstance(_designerType);
    }

    public override void Initialize(IComponent component)
    {
      visible = ((DbCommand)component).DesignTimeVisible;

      ((ComponentDesigner)_designer).Initialize(component);
      base.Initialize(component);
    }

    public bool GetCommandDesignTimeVisible(IDbCommand cmd)
    {
      return visible;
    }

    public void SetCommandDesignTimeVisible(IDbCommand cmd, bool value)
    {
      visible = value;
      TypeDescriptor.Refresh(cmd);
    }

    protected override void PreFilterAttributes(System.Collections.IDictionary attributes)
    {
      base.PreFilterAttributes(attributes);
      DesignTimeVisibleAttribute att = new DesignTimeVisibleAttribute(visible);
      attributes[att.TypeId] = att;
    }

    public override DesignerVerbCollection Verbs
    {
      get
      {
        return ((ComponentDesigner)_designer).Verbs;
      }
    }
    #region IExtenderProvider Members

    public bool CanExtend(object extendee)
    {
      return (extendee is DbCommand);
    }

    #endregion
  }
}

Changes to SQLite.Designer/SQLiteDataAdapterToolboxItem.cs.

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
..
42
43
44
45
46
47
48


















49
50
51
52
53
54
55
  using System.ComponentModel;
  using System.ComponentModel.Design;
  using System.Drawing.Design;
  using System.Data.SQLite;
  using System.Data.Common;
  using System.Reflection;
  using System.Collections.Generic;






  internal sealed class SQLiteDataAdapterToolboxItem : ToolboxItem
  {



    public SQLiteDataAdapterToolboxItem()
    {


















    }

    protected override IComponent[] CreateComponentsCore(IDesignerHost host)
    {
      SQLiteDataAdapter adp = new SQLiteDataAdapter();

      if (adp == null) return null;

      List<IComponent> list = new List<IComponent>();
      IContainer container = host.Container;

      adp.SelectCommand = new SQLiteCommand();
      adp.SelectCommand.DesignTimeVisible = false;
      container.Add(adp.SelectCommand, GenerateName(container, "SelectCommand"));

      adp.InsertCommand = new SQLiteCommand();
................................................................................

      ITypeResolutionService res = (ITypeResolutionService)host.GetService(typeof(ITypeResolutionService));
      if (res != null)
      {
        res.ReferenceAssembly(typeof(SQLiteDataAdapter).Assembly.GetName());
      }
      container.Add(adp);


















    }

    private static string GenerateName(IContainer container, string baseName)
    {
      ComponentCollection coll = container.Components;
      string uniqueName;
      int n = 1;







>
>
>

>
>


>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  using System.ComponentModel;
  using System.ComponentModel.Design;
  using System.Drawing.Design;
  using System.Data.SQLite;
  using System.Data.Common;
  using System.Reflection;
  using System.Collections.Generic;
  using System.Windows.Forms;
  using System.Drawing;
  using System.Runtime.Serialization;

  [Serializable]
  [ToolboxItem(typeof(SQLiteDataAdapterToolboxItem))]
  internal sealed class SQLiteDataAdapterToolboxItem : ToolboxItem
  {
    private static Type _wizard = null;
    internal static Assembly _vsdesigner = null;

    static SQLiteDataAdapterToolboxItem()
    {
      _vsdesigner = Assembly.Load("Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");

      _wizard = _vsdesigner.GetType("Microsoft.VSDesigner.Data.VS.DataAdapterWizard");
    }

    public SQLiteDataAdapterToolboxItem(Type type) : this(type, (Bitmap)null)
    {
    }


    public SQLiteDataAdapterToolboxItem(Type type, Bitmap bmp) : base(typeof(SQLiteDataAdapter))
    {
      DisplayName = "SQLiteDataAdapter";
    }

    private SQLiteDataAdapterToolboxItem(SerializationInfo info, StreamingContext context) : base(typeof(SQLiteDataAdapter))
    {
      Deserialize(info, context);
    }

    protected override IComponent[] CreateComponentsCore(IDesignerHost host)
    {
      SQLiteDataAdapter adp = new SQLiteDataAdapter();

      if (adp == null) return null;


      IContainer container = host.Container;

      adp.SelectCommand = new SQLiteCommand();
      adp.SelectCommand.DesignTimeVisible = false;
      container.Add(adp.SelectCommand, GenerateName(container, "SelectCommand"));

      adp.InsertCommand = new SQLiteCommand();
................................................................................

      ITypeResolutionService res = (ITypeResolutionService)host.GetService(typeof(ITypeResolutionService));
      if (res != null)
      {
        res.ReferenceAssembly(typeof(SQLiteDataAdapter).Assembly.GetName());
      }
      container.Add(adp);

      List<IComponent> list = new List<IComponent>();
      list.Add(adp);

      if (_wizard != null)
      {
        using (Form wizard = (Form)Activator.CreateInstance(_wizard, new object[] { host, adp }))
        {
          wizard.ShowDialog();
        }
      }

      if (adp.SelectCommand != null) list.Add(adp.SelectCommand);
      if (adp.InsertCommand != null) list.Add(adp.InsertCommand);
      if (adp.DeleteCommand != null) list.Add(adp.DeleteCommand);
      if (adp.UpdateCommand != null) list.Add(adp.UpdateCommand);

      return list.ToArray();      
    }

    private static string GenerateName(IContainer container, string baseName)
    {
      ComponentCollection coll = container.Components;
      string uniqueName;
      int n = 1;

Changes to System.Data.SQLite/SQLiteCommand.cs.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
96
97
98
99
100
101
102












103
104
105
106
107
108
109
...
569
570
571
572
573
574
575

576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
  using System.Collections.Generic;
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbCommand.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [Designer("Microsoft.VSDesigner.Data.VS.DataCommandDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), ToolboxItem(true)]
#endif
  public sealed class SQLiteCommand : DbCommand, ICloneable
  {
    /// <summary>
    /// The command text this command is based on
    /// </summary>
    private string _commandText;
................................................................................
    /// Initializes the command and associates it with the specified connection.
    /// </summary>
    /// <param name="connection">The connection to associate with the command</param>
    public SQLiteCommand(SQLiteConnection connection) 
      : this(null, connection, null)
    {
    }













    /// <summary>
    /// Initializes a command with the given SQL, connection and transaction
    /// </summary>
    /// <param name="commandText">The SQL command text</param>
    /// <param name="connection">The connection to associate with the command</param>
    /// <param name="transaction">The transaction the command should be associated with</param>
................................................................................
      get
      {
        return _designTimeVisible;
      }
      set
      {
        _designTimeVisible = value;

      }
    }

    /// <summary>
    /// Clones a command, including all its parameters
    /// </summary>
    /// <returns>A new SQLiteCommand with the same commandtext, connection and parameters</returns>
    public object Clone()
    {
      SQLiteCommand newcommand = new SQLiteCommand(CommandText, Connection as SQLiteConnection);
      foreach (SQLiteParameter param in _parameterCollection)
      {
        newcommand.Parameters.Add(param.Clone());
      }
      return newcommand;
    }
  }
}







|







 







>
>
>
>
>
>
>
>
>
>
>
>







 







>









<
<
<
<
<
|



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597





598
599
600
601
  using System.Collections.Generic;
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbCommand.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [Designer("SQLite.Designer.SQLiteCommandDesigner, SQLite.Designer, Version=1.0.26.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"), ToolboxItem(true)]
#endif
  public sealed class SQLiteCommand : DbCommand, ICloneable
  {
    /// <summary>
    /// The command text this command is based on
    /// </summary>
    private string _commandText;
................................................................................
    /// Initializes the command and associates it with the specified connection.
    /// </summary>
    /// <param name="connection">The connection to associate with the command</param>
    public SQLiteCommand(SQLiteConnection connection) 
      : this(null, connection, null)
    {
    }

    private SQLiteCommand(SQLiteCommand source) : this(source.CommandText, source.Connection, source.Transaction)
    {
      CommandTimeout = source.CommandTimeout;
      DesignTimeVisible = source.DesignTimeVisible;
      UpdatedRowSource = source.UpdatedRowSource;

      foreach (SQLiteParameter param in source._parameterCollection)
      {
        Parameters.Add(param.Clone());
      }
    }

    /// <summary>
    /// Initializes a command with the given SQL, connection and transaction
    /// </summary>
    /// <param name="commandText">The SQL command text</param>
    /// <param name="connection">The connection to associate with the command</param>
    /// <param name="transaction">The transaction the command should be associated with</param>
................................................................................
      get
      {
        return _designTimeVisible;
      }
      set
      {
        _designTimeVisible = value;
        TypeDescriptor.Refresh(this);
      }
    }

    /// <summary>
    /// Clones a command, including all its parameters
    /// </summary>
    /// <returns>A new SQLiteCommand with the same commandtext, connection and parameters</returns>
    public object Clone()
    {





      return new SQLiteCommand(this);
    }
  }
}

Changes to System.Data.SQLite/SQLiteDataAdapter.cs.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbDataAdapter.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [DefaultEvent("RowUpdated")]
  [ToolboxItem("Microsoft.VSDesigner.Data.VS.SqlDataAdapterToolboxItem, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
  [Designer("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
  public sealed class SQLiteDataAdapter : DbDataAdapter
  {
    private static object _updatingEventPH = new object();
    private static object _updatedEventPH = new object();








|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System.ComponentModel;

  /// <summary>
  /// SQLite implementation of DbDataAdapter.
  /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
  [DefaultEvent("RowUpdated")]
  [ToolboxItem("SQLite.Designer.SQLiteDataAdapterToolboxItem, SQLite.Designer, Version=1.0.26.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139")]
  [Designer("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
#endif
  public sealed class SQLiteDataAdapter : DbDataAdapter
  {
    private static object _updatingEventPH = new object();
    private static object _updatedEventPH = new object();