System.Data.SQLite

Check-in [dca07f2301]
Login

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

Overview
Comment:Refine the SQLiteTypeCallbacks class.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | customDataTypes
Files: files | file ages | folders
SHA1: dca07f23012a5178659451c690bba9d5c4839f9c
User & Date: mistachkin 2016-06-19 03:49:29.958
Context
2016-06-19
06:44
Merge updates from trunk. check-in: 16ef12980e user: mistachkin tags: customDataTypes
03:49
Refine the SQLiteTypeCallbacks class. check-in: dca07f2301 user: mistachkin tags: customDataTypes
03:44
Improve comments. check-in: 410f1fa7fc user: mistachkin tags: customDataTypes
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteConnection.cs.
541
542
543
544
545
546
547
548
549
550
551
552






553
554
555
























556
557
558
559
560
561
562
563
564
565
566
567
568
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
594
595

596
597
598
599
600
601
602
      /// <see cref="ReadValueUserData" /> property.
      /// </summary>
      private object readValueUserData;
      #endregion

      /////////////////////////////////////////////////////////////////////////

      #region Public Constructors
      /// <summary>
      /// Constructs an instance of this class.
      /// </summary>
      /// <param name="typeName">






      /// The database type name that the callbacks contained in this class
      /// will apply to.  This parameter may not be null.
      /// </param>
























      /// <param name="bindValueCallback">
      /// The custom paramater binding callback.  This parameter may be null.
      /// </param>
      /// <param name="readValueCallback">
      /// The custom data reader value callback.  This parameter may be null.
      /// </param>
      /// <param name="bindValueUserData">
      /// The extra data to pass into the parameter binding callback.  This
      /// parameter may be null.
      /// </param>
      /// <param name="readValueUserData">
      /// The extra data to pass into the data reader value callback.  This
      /// parameter may be null.
      /// </param>
      public SQLiteTypeCallbacks(
          string typeName,
          SQLiteBindValueCallback bindValueCallback,
          SQLiteReadValueCallback readValueCallback,
          object bindValueUserData,
          object readValueUserData
          )
      {
          this.typeName = typeName;
          this.bindValueCallback = bindValueCallback;
          this.readValueCallback = readValueCallback;
          this.bindValueUserData = bindValueUserData;
          this.readValueUserData = readValueUserData;
      }
      #endregion

      /////////////////////////////////////////////////////////////////////////

      #region Public Properties
      /// <summary>
      /// The database type name that the callbacks contained in this class
      /// will apply to.  This value may not be null.
      /// </summary>
      public string TypeName
      {
          get { return typeName; }

      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// The custom paramater binding callback.  This value may be null.
      /// </summary>







|



|
>
>
>
>
>
>
|
|

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














|
<






<
|
|
<
|













>







541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
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
594
595
596
597
598
599
600

601
602
603
604
605
606

607
608

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
      /// <see cref="ReadValueUserData" /> property.
      /// </summary>
      private object readValueUserData;
      #endregion

      /////////////////////////////////////////////////////////////////////////

      #region Private Constructors
      /// <summary>
      /// Constructs an instance of this class.
      /// </summary>
      /// <param name="bindValueCallback">
      /// The custom paramater binding callback.  This parameter may be null.
      /// </param>
      /// <param name="readValueCallback">
      /// The custom data reader value callback.  This parameter may be null.
      /// </param>
      /// <param name="bindValueUserData">
      /// The extra data to pass into the parameter binding callback.  This
      /// parameter may be null.
      /// </param>
      /// <param name="readValueUserData">
      /// The extra data to pass into the data reader value callback.  This
      /// parameter may be null.
      /// </param>
      private SQLiteTypeCallbacks(
          SQLiteBindValueCallback bindValueCallback,
          SQLiteReadValueCallback readValueCallback,
          object bindValueUserData,
          object readValueUserData
          )
      {
          this.bindValueCallback = bindValueCallback;
          this.readValueCallback = readValueCallback;
          this.bindValueUserData = bindValueUserData;
          this.readValueUserData = readValueUserData;
      }
      #endregion

      /////////////////////////////////////////////////////////////////////////

      #region Static "Factory" Methods
      /// <summary>
      /// Creates an instance of the <see cref="SQLiteTypeCallbacks" /> class.
      /// </summary>
      /// <param name="bindValueCallback">
      /// The custom paramater binding callback.  This parameter may be null.
      /// </param>
      /// <param name="readValueCallback">
      /// The custom data reader value callback.  This parameter may be null.
      /// </param>
      /// <param name="bindValueUserData">
      /// The extra data to pass into the parameter binding callback.  This
      /// parameter may be null.
      /// </param>
      /// <param name="readValueUserData">
      /// The extra data to pass into the data reader value callback.  This
      /// parameter may be null.
      /// </param>
      public static SQLiteTypeCallbacks Create(

          SQLiteBindValueCallback bindValueCallback,
          SQLiteReadValueCallback readValueCallback,
          object bindValueUserData,
          object readValueUserData
          )
      {

          return new SQLiteTypeCallbacks(
              bindValueCallback, readValueCallback, bindValueUserData,

              readValueUserData);
      }
      #endregion

      /////////////////////////////////////////////////////////////////////////

      #region Public Properties
      /// <summary>
      /// The database type name that the callbacks contained in this class
      /// will apply to.  This value may not be null.
      /// </summary>
      public string TypeName
      {
          get { return typeName; }
          internal set { typeName = value; }
      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// The custom paramater binding callback.  This value may be null.
      /// </summary>
2116
2117
2118
2119
2120
2121
2122

2123

2124
2125
2126
2127
2128
2129
2130

        if (_typeCallbacks == null)
            return false;

        if (callbacks == null)
            return _typeCallbacks.Remove(typeName);


        _typeCallbacks[typeName] = callbacks;

        return true;
    }
    #endregion

    ///////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>







>

>







2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160

        if (_typeCallbacks == null)
            return false;

        if (callbacks == null)
            return _typeCallbacks.Remove(typeName);

        callbacks.TypeName = typeName;
        _typeCallbacks[typeName] = callbacks;

        return true;
    }
    #endregion

    ///////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>