diff --git a/.gitignore b/.gitignore
index 9491a2f..eba0500 100644
--- a/.gitignore
+++ b/.gitignore
@@ -360,4 +360,23 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
-FodyWeavers.xsd
\ No newline at end of file
+FodyWeavers.xsd
+# --- varManager .NET 8 / SQLite modernization ---
+dist/
+*.sqlite
+*.sqlite-shm
+*.sqlite-wal
+varManager.migration.log
+
+
+# test-only scaffolding (not for upstream PR)
+*.asinvoker.manifest
+
+
+# redundant backups of pre-modernization files (original is in git history)
+migration/legacy/
+
+
+# dev-only verification harness (not product code)
+tests/
+
diff --git a/DgvFilterPopup/DgvFilterPopup.csproj b/DgvFilterPopup/DgvFilterPopup.csproj
new file mode 100644
index 0000000..778c432
--- /dev/null
+++ b/DgvFilterPopup/DgvFilterPopup.csproj
@@ -0,0 +1,21 @@
+
+
+
+
+ Library
+ net8.0-windows
+ true
+ latest
+ disable
+ disable
+ DgvFilterPopup
+ DgvFilterPopup
+ Vincenzo Rossi, Faryan Rezagholi
+ 2009-2021
+ 1.3.1
+
+
+
diff --git a/DgvFilterPopup/DgvFilterPopup.snk b/DgvFilterPopup/DgvFilterPopup.snk
new file mode 100644
index 0000000..233d93e
Binary files /dev/null and b/DgvFilterPopup/DgvFilterPopup.snk differ
diff --git a/DgvFilterPopup/Diagrams/BasicDiagram.cd b/DgvFilterPopup/Diagrams/BasicDiagram.cd
new file mode 100644
index 0000000..6339e8e
--- /dev/null
+++ b/DgvFilterPopup/Diagrams/BasicDiagram.cd
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ FilterPopup\DgvFilterManager.cs
+ EEAAIKAIABAAkgACCIhAIQAAAACABBCABgBABAIAABA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\DgvBaseColumnFilter.cs
+ FQAAAgIBAAKAAhAJIBBqAFAAAAAgAMw0AEECAAgAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\DgvBaseFilterHost.cs
+ JBAAAQAAABBBBBUAAAACAAAAAAAACMAAAAAAAAAAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/Diagrams/DetailDiagram.cd b/DgvFilterPopup/Diagrams/DetailDiagram.cd
new file mode 100644
index 0000000..83d7983
--- /dev/null
+++ b/DgvFilterPopup/Diagrams/DetailDiagram.cd
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ FilterPopup\DgvFilterManager.cs
+ EEAAIKAIABAAkgACCIhAIQAAAACADBCABgBABAIAABA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\DgvBaseColumnFilter.cs
+ FQAAAgIBAAKAAhAJIBBqAFAAAAAgAMw0AEECAAgAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\DgvBaseFilterHost.cs
+ JBAAAQAAABBBBBUAAAACAAAAAAAACMAAAAAAAAAAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/Diagrams/Extensions.cd b/DgvFilterPopup/Diagrams/Extensions.cd
new file mode 100644
index 0000000..c722bc3
--- /dev/null
+++ b/DgvFilterPopup/Diagrams/Extensions.cd
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+ FilterPopup\Extensions\DgvDateRangeColumnFilter.cs
+ AAAAAAAAAHAAAAAAAACAIAACACAAAAAEAAAAABgCgAA=
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Extensions\DgvMonthYearColumnFilter.cs
+ AAAAACIAAGAAAAAAAADAAAACIAAAAiCEAQAABAgAAAQ=
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Extensions\DgvNumRangeColumnFilter.cs
+ AAAAAAAAAHEAAAAAAACAAAACAAAAAEAEAABAABgBAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\DgvBaseColumnFilter.cs
+ FQAAAgIBAAKAAhAJIBBqAFAAAAAgAMw0AEECAAgAAAA=
+
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/Diagrams/Implementations.cd b/DgvFilterPopup/Diagrams/Implementations.cd
new file mode 100644
index 0000000..94c3388
--- /dev/null
+++ b/DgvFilterPopup/Diagrams/Implementations.cd
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ FilterPopup\DgvBaseFilterHost.cs
+ JBAAAQAAABBBBBUAAAACAAAAAAAACMAAAAAAAAAAAAA=
+
+
+
+
+
+ FilterPopup\DgvBaseColumnFilter.cs
+ FQAAAgIBAAKAAhAJIBBqAFAAAAAgAMw0AEECAAgAAAA=
+
+
+
+
+
+ FilterPopup\Implementations\DgvCheckBoxColumnFilter.cs
+ AAAAAQAAAHAAAAAAAACAAAACAAAAAAAEAAAAABgAAAE=
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Implementations\DgvComboBoxColumnFilter.cs
+ AAABEAAAAHAAAAAAAACAAAACAAAAAAAEAAAAABgAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Implementations\DgvDateColumnFilter.cs
+ AAAAAAAAAHAAAAAAAACAAAACAAAAAAAEAAAAABgCgAA=
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Implementations\DgvTextBoxColumnFilter.cs
+ AAAAAAAAAHAAAAAAAACAAAACAAAAAEAEAABAABgAAAA=
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FilterPopup\Implementations\DgvFilterHost.cs
+ AAAAAAAAACAAAAQAAECAAAAiAAECAgAgAAAAAQJAAAA=
+
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/ColumnFilterEvent.cs b/DgvFilterPopup/FilterPopup/ColumnFilterEvent.cs
new file mode 100644
index 0000000..f49d13c
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/ColumnFilterEvent.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// Represents the method that will handle an event related to a column filter.
+///
+/// The source of the event.
+/// The instance containing the event data.
+public delegate void ColumnFilterEventHandler(object sender, ColumnFilterEventArgs e);
+
+///
+/// Provides data for a column filter event.
+///
+public class ColumnFilterEventArgs : EventArgs
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The DstaGridView column.
+ /// The column filter instance.
+ public ColumnFilterEventArgs(DataGridViewColumn Column, DgvBaseColumnFilter ColumnFilter)
+ {
+ this.Column = Column;
+ this.ColumnFilter = ColumnFilter;
+ Handled = Handled;
+ }
+
+
+ #region PRIVATE FIELDS
+
+ #endregion
+
+
+ #region PROPERTIES
+
+ ///
+ /// Gets the DataGridView column involved in the event.
+ ///
+ public DataGridViewColumn Column { get; }
+
+
+ ///
+ /// Gets or sets the column filter instance.
+ ///
+ /// A column filter instance.
+ public DgvBaseColumnFilter ColumnFilter { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether this is handled.
+ ///
+ /// true if handled; otherwise, false.
+ public bool Handled { get; set; }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/DgvBaseColumnFilter.cs b/DgvFilterPopup/FilterPopup/DgvBaseColumnFilter.cs
new file mode 100644
index 0000000..9041ddc
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/DgvBaseColumnFilter.cs
@@ -0,0 +1,321 @@
+using System;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Globalization;
+using System.Text;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// Specifies how the column filter control is horizontally aligned inside the filter host.
+///
+public enum HFilterAlignment
+{
+ Top,
+ Bottom,
+ Middle
+}
+
+///
+/// Specifies how the column filter control is vertically aligned inside the filter host.
+///
+public enum VFilterAlignment
+{
+ Left,
+ Right,
+ Center
+}
+
+///
+/// The base class from which to derive effective column filter classes
+///
+///
+/// The purpose of a column filter control is to contain visual elements allowing the end user to construct a
+/// filter.
+/// When inheriting from it, you can work just like creating any other user control.
+/// This class is a derivation of UserControl and provide functionalities to
+/// cooperate with DgvFilterManager.
+///
+/// NOTE:
+/// This class must be intended as an abstract class. However, declaring it as abstract,
+/// would generate errors whitin the designer when designing derived classes.
+///
+///
+/// You should override to provide a filter
+/// expression construction
+/// logic and to set the values of the and
+/// properties.
+///
+///
+public class DgvBaseColumnFilter : UserControl
+{
+ #region EVENTS
+
+ ///
+ /// Occurs before the filter expression is about to be built.
+ ///
+ public event CancelEventHandler FilterExpressionBuilding;
+
+
+ ///
+ /// Occurs when the filter column is about to be initialized.
+ ///
+ public event CancelEventHandler FilterInitializing;
+
+ #endregion
+
+
+ #region PRIVATE FIELDS
+
+ private string mFilterCaption = "";
+
+ #endregion
+
+
+ #region PROPERTIES
+
+ ///
+ /// Gets or sets a value indicating whether filter apply soon after a user performs some changes.
+ ///
+ /// true (default) if to apply soon; otherwise, false.
+ public bool FilterApplySoon { get; set; } = true;
+
+ ///
+ /// Gets and sets the filter expression.
+ ///
+ ///
+ /// It's the filter expression on the column. Its value is used by the to build the
+ /// whole filter expression.
+ /// In inherited class, set its value in the override of .
+ /// The filter expression must follow the rules of the DataView property.
+ ///
+ public string FilterExpression { get; set; } = "";
+
+ ///
+ /// Gets and sets the caption to show in the column header when the filter is active.
+ ///
+ ///
+ /// Represents the caption to show in the column header when the filter is active.
+ /// In inherited class, set its value in the override of .
+ ///
+ public string FilterCaption
+ {
+ get => Active && FilterExpression != "" ? mFilterCaption : OriginalDataGridViewColumnHeaderText;
+ set => mFilterCaption = value;
+ }
+
+
+ ///
+ /// Gets or sets a value indicating whether the filter is active.
+ ///
+ /// true if active; otherwise, false.
+ public bool Active { get; set; }
+
+ ///
+ /// Specifies how the column filter control is horizontally aligned inside the filter host.
+ ///
+ public HFilterAlignment HFilterAlignment { get; set; } = HFilterAlignment.Middle;
+
+
+ ///
+ /// Specifies how the column filter control is vertically aligned inside the filter host.
+ ///
+ public VFilterAlignment VFilterAlignment { get; set; } = VFilterAlignment.Center;
+
+
+ ///
+ /// Gets the DataView acting as the data source of the DataGridView to which this column filter is
+ /// applied.
+ ///
+ public DataView BoundDataView { get; private set; }
+
+
+ ///
+ /// Gets the filter host control in which this column filter is shown.
+ ///
+ public DgvBaseFilterHost FilterHost { get; private set; }
+
+
+ ///
+ /// Gets the filter manager.
+ ///
+ public DgvFilterManager FilterManager { get; private set; }
+
+
+ ///
+ /// Gets the DataGridView column to which this column filter is applied.
+ ///
+ /// The data grid view column.
+ public DataGridViewColumn DataGridViewColumn { get; private set; }
+
+
+ ///
+ /// Gets the type of the data bound to the DataGridView column.
+ ///
+ public Type ColumnDataType { get; private set; }
+
+
+ ///
+ /// Gets the original DataGridView column header text.
+ ///
+ public string OriginalDataGridViewColumnHeaderText { get; private set; }
+
+ #endregion
+
+
+ #region FILTER INITIALIZATION, EXPRESSION BUILDING, EVENT MANAGING
+
+ ///
+ /// Called by the filter manager, inits the column filter and raises the FilterInitializing event.
+ ///
+ /// The filter manager.
+ /// The filter host.
+ /// The DataGridView column.
+ /// The bound data view.
+ public void Init(DgvFilterManager FilterManager, DgvBaseFilterHost FilterHost, DataGridViewColumn gridColumn,
+ DataView boundDataView)
+ {
+ this.FilterManager = FilterManager;
+ this.FilterHost = FilterHost;
+ DataGridViewColumn = gridColumn;
+ BoundDataView = boundDataView;
+ OriginalDataGridViewColumnHeaderText = gridColumn.HeaderText;
+ if (gridColumn.DataPropertyName != "")
+ ColumnDataType = boundDataView.Table.Columns[gridColumn.DataPropertyName].DataType;
+ else
+ ColumnDataType = typeof(string);
+ FilterHost.FilterClientArea.Controls.Add(this);
+ FilterHost.Location = new Point(0, 0);
+ Visible = false;
+ var e = new CancelEventArgs(false);
+ OnFilterInitializing(this, e);
+ }
+
+ ///
+ /// Raises the event
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code.
+ ///
+ protected virtual void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ // Ovverride to add custom init code
+ if (FilterInitializing != null) FilterInitializing(sender, e);
+ }
+
+ ///
+ /// Forces the rebuilt of filter expression
+ ///
+ ///
+ /// This method is called by when popup is closed, to
+ /// force recreation of the filter expression.
+ ///
+ public void FilterExpressionBuild()
+ {
+ var e = new CancelEventArgs(false);
+ OnFilterExpressionBuilding(this, e);
+ }
+
+ ///
+ /// Raises the event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ ///
+ protected virtual void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ if (FilterExpressionBuilding != null) FilterExpressionBuilding(sender, e);
+ }
+
+ #endregion
+
+
+ #region HELPERS
+
+ ///
+ /// Escapes a string to be suitable for filter expression.
+ ///
+ /// The string to escape.
+ /// The escaped string
+ public static string StringEscape(string s)
+ {
+ var sarray = s.ToCharArray();
+ var sb = new StringBuilder(s.Length * 2);
+ foreach (var c in sarray)
+ switch (c)
+ {
+ case '%':
+ case '*':
+ case '[':
+ case ']':
+ sb.Append("[" + c + "]");
+ break;
+ case '\'':
+ sb.Append("''");
+ break;
+ default:
+ sb.Append(c);
+ break;
+ }
+
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the string representation of the passed value, based on target type.
+ ///
+ /// The value to be formatted.
+ /// The target type.
+ /// The string representation of the passed value
+ public static string FormatValue(object value, Type targetType)
+ {
+ if (targetType == typeof(string)) return "'" + value + "'";
+ try
+ {
+ value = Convert.ChangeType(value, targetType);
+ }
+ catch
+ {
+ return "";
+ }
+
+ if (targetType == typeof(bool)) return (bool)value ? "1" : "0";
+ if (targetType == typeof(DateTime)) return "'" + ((DateTime)value).ToString("yyyy'-'MM'-'dd") + "'";
+ //Numeric types
+ return ((IFormattable)value).ToString(null, NumberFormatInfo.InvariantInfo);
+ }
+
+ ///
+ /// Returns a null condition string to be used in filter expression.
+ ///
+ /// Name of the data column.
+ /// A string to be used in the filter expression representing a null condition
+ public static string GetNullCondition(string DataColumnName)
+ {
+ return "ISNULL(CONVERT(" + DataColumnName + ",'System.String'),'NULLVALUE') = 'NULLVALUE'";
+ }
+
+ ///
+ /// Returns a not null condition string to be used in filter expression.
+ ///
+ /// Name of the data column.
+ /// A string to be used in the filter expression representing a not null condition
+ public static string GetNotNullCondition(string DataColumnName)
+ {
+ return "ISNULL(CONVERT(" + DataColumnName + ",'System.String'),'NULLVALUE') <> 'NULLVALUE'";
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/DgvBaseFilterHost.cs b/DgvFilterPopup/FilterPopup/DgvBaseFilterHost.cs
new file mode 100644
index 0000000..0d77efa
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/DgvBaseFilterHost.cs
@@ -0,0 +1,278 @@
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// The base class from which to derive effective filter host controls
+///
+///
+/// The purpose of the filter host control is to show a popup near a right-clicked column and to
+/// host child column filter controls.
+/// When the popup is shown, only the column filter control related to right-clicked column
+/// is visibile.
+/// DgvBaseFilterHost is a derivation of UserControl and provide functionalities to
+/// cooperate with .
+///
+/// NOTE:
+/// This class must be intended as an abstract class. However, declaring it as abstract,
+/// would generate errors whitin the designer when designing derived classes.
+///
+///
+/// In your derivation, you have to provide a host area (such as a panel) and ovverride the
+/// to return it. Also, create visual elements
+/// for remove filter, remove all filters, apply filter and use the
+/// DgvFilterManager methods and
+/// .
+///
+///
+///
+///
+/// public partial class DgvFilterHost : DgvBaseFilterHost {
+///
+/// public DgvFilterHost() {
+/// InitializeComponent();
+/// this.CurrentColumnFilterChanged += new EventHandler(DgvFilterHost_CurrentColumnFilterChanged);
+/// }
+///
+/// void DgvFilterHost_CurrentColumnFilterChanged(object sender, EventArgs e) {
+/// lblColumnName.Text = CurrentColumnFilter.OriginalDataGridViewColumnHeaderText;
+/// }
+///
+/// public override Control FilterClientArea {
+/// get {
+/// return this.panelFilterArea;
+/// }
+/// }
+///
+/// private void tsOK_Click(object sender, EventArgs e) {
+/// FilterManager.ActivateFilter(true);
+/// this.Popup.Close();
+/// }
+///
+/// private void tsRemove_Click(object sender, EventArgs e) {
+/// FilterManager.ActivateFilter(false);
+/// this.Popup.Close();
+/// }
+///
+/// private void tsRemoveAll_Click(object sender, EventArgs e) {
+/// FilterManager.ActivateAllFilters(false);
+/// this.Popup.Close();
+/// }
+///
+/// }
+///
+///
+public class DgvBaseFilterHost : UserControl
+{
+ #region EVENTS
+
+ ///
+ /// Occurs when the current visible column filter is changed.
+ ///
+ public event EventHandler CurrentColumnFilterChanged;
+
+ #endregion
+
+
+ #region PRIVATE FIELDS
+
+ private ToolStripDropDown mPopup;
+ private DgvBaseColumnFilter mCurrentColumnFilter;
+
+ #endregion
+
+
+ #region PROPERTIES
+
+ ///
+ /// Return the effective area to which column filters will be added.
+ ///
+ public virtual Control FilterClientArea => this;
+
+
+ ///
+ /// Gets the ToolStripDropDown object used to popup the filter host
+ ///
+ public ToolStripDropDown Popup
+ {
+ get
+ {
+ if (mPopup == null)
+ {
+ mPopup = new ToolStripDropDown();
+ var ControlHost = new ToolStripControlHost(this);
+ ControlHost.Padding = Padding.Empty;
+ ControlHost.Margin = Padding.Empty;
+ ControlHost.AutoSize = false;
+ mPopup.Padding = Padding.Empty;
+ mPopup.Items.Add(ControlHost);
+ mPopup.Region = Region;
+ }
+
+ return mPopup;
+ }
+ }
+
+
+ ///
+ /// Gets or sets the filter manger
+ ///
+ public DgvFilterManager FilterManager { set; get; }
+
+
+ ///
+ /// Gets or sets the currently visibile column filter control
+ ///
+ public DgvBaseColumnFilter CurrentColumnFilter
+ {
+ get => mCurrentColumnFilter;
+ set
+ {
+ // Called once: store the original size difference of the filterhost and the filterClientArea
+ if (SizeDifference == Size.Empty)
+ {
+ SizeDifference = Size.Subtract(Size, FilterClientArea.Size);
+ MinimumSize = Size;
+ }
+
+ if (mCurrentColumnFilter != null) mCurrentColumnFilter.Visible = false;
+ mCurrentColumnFilter = value;
+ DoAutoFit();
+ if (CurrentColumnFilterChanged != null)
+ {
+ var e = new EventArgs();
+ CurrentColumnFilterChanged(this, e);
+ }
+
+ mCurrentColumnFilter.Visible = true;
+ }
+ }
+
+
+ ///
+ /// Gets the original size difference of the filter host and the
+ /// .
+ ///
+ public Size SizeDifference { get; private set; }
+
+ #endregion
+
+
+ #region HELPERS
+
+ ///
+ /// Performs growing / shrinking of the filter host to best fit the current visibile column filter.
+ ///
+ ///
+ /// Ovverride this method to provide your own resize logic.
+ ///
+ protected virtual void DoAutoFit()
+ {
+ var NewHostSize = Size.Add(SizeDifference, mCurrentColumnFilter.Size);
+ NewHostSize.Width = Math.Max(NewHostSize.Width, MinimumSize.Width);
+ NewHostSize.Height = Math.Max(NewHostSize.Height, MinimumSize.Height);
+ Size = NewHostSize;
+
+ FilterClientArea.Size = Size.Subtract(NewHostSize, SizeDifference);
+ AlignFilter();
+ }
+
+ ///
+ /// Aligns the column filter into the filter client area.
+ ///
+ ///
+ /// Ovverride this method to provide your own alignment logic.
+ ///
+ protected void AlignFilter()
+ {
+ var x = 0; // VFilterAlignmentType.Left:
+ var y = 0; // HFilterAlignmentType.Top:
+ switch (mCurrentColumnFilter.VFilterAlignment)
+ {
+ case VFilterAlignment.Right:
+ x = FilterClientArea.Width - mCurrentColumnFilter.Width;
+ break;
+ case VFilterAlignment.Center:
+ x = (FilterClientArea.Width - mCurrentColumnFilter.Width) / 2;
+ break;
+ }
+
+ switch (mCurrentColumnFilter.HFilterAlignment)
+ {
+ case HFilterAlignment.Bottom:
+ y = FilterClientArea.Height - mCurrentColumnFilter.Height;
+ break;
+ case HFilterAlignment.Middle:
+ y = (FilterClientArea.Height - mCurrentColumnFilter.Height) / 2;
+ break;
+ }
+
+ mCurrentColumnFilter.Location = new Point(x, y);
+ }
+
+ ///
+ /// Returns a region based on the transparency color of a bitmap.
+ ///
+ /// The bitmap.
+ /// The transparency color.
+ /// A region
+ public static Region BitmapToRegion(Bitmap bitmap, Color transparencyColor)
+ {
+ if (bitmap == null)
+ throw new ArgumentNullException("Bitmap", "Bitmap cannot be null!");
+
+ var height = bitmap.Height;
+ var width = bitmap.Width;
+
+ var path = new GraphicsPath();
+
+ for (var j = 0; j < height; j++)
+ for (var i = 0; i < width; i++)
+ {
+ if (bitmap.GetPixel(i, j) == transparencyColor)
+ continue;
+
+ var x0 = i;
+
+ while (i < width && bitmap.GetPixel(i, j) != transparencyColor)
+ i++;
+
+ path.AddRectangle(new Rectangle(x0, j, i - x0, 1));
+ }
+
+ var region = new Region(path);
+ path.Dispose();
+ return region;
+ }
+
+ ///
+ /// Registers the a combo box.
+ ///
+ /// The combo box.
+ ///
+ /// When the user clicks on an ComboBox item that is outside of the
+ /// host area, this cause an unwanted closing of the filter host.
+ /// If you use a ComboBox in a customized column filter,
+ /// be sure to call this method in your filter intitialitazion code.
+ ///
+ public void RegisterComboBox(ComboBox comboBox)
+ {
+ comboBox.DropDown += onDropDown;
+ comboBox.DropDownClosed += onDropDownClosed;
+ }
+
+ private void onDropDown(object sender, EventArgs e)
+ {
+ Popup.AutoClose = false;
+ }
+
+ private void onDropDownClosed(object sender, EventArgs e)
+ {
+ Popup.AutoClose = true;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/DgvFilterManager.cs b/DgvFilterPopup/FilterPopup/DgvFilterManager.cs
new file mode 100644
index 0000000..261c23a
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/DgvFilterManager.cs
@@ -0,0 +1,650 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.Windows.Forms;
+using DgvFilterPopup.Properties;
+
+namespace DgvFilterPopup;
+
+///
+/// The main class involved in adding filtering capabilities to a DataGridView.
+///
+///
+/// This is the class that you use to add filtering capabilities to a DataGridView. The
+/// DataGridView must be data bound to a DataTable, a DataView or a BindingSource which in
+/// turn is
+/// bound to one of these two.
+/// When you assign a DataGridView to a DgvFilterManager, it attaches some handlers to respond
+/// to right click on column headers and to perform some custom painting on the grid.
+/// When the user right clicks a column header, the DgvFilterManager shows a popup near the column.
+/// This popup is a control that serves as host for other controls, one for each column. Only one of
+/// these child controls is visibile, based on clicked column.
+/// We have one filter host control and many column filter child controls.
+///
+/// The filter host control must be a derivation of the class, while filter
+/// controls must be
+/// derived by the class. These two classes don't provide any user interface.
+/// As a default, DgvFilterManager uses the standard derivation DgvFilterHost and, depending on
+/// column type and data type,
+/// one of the standard derivations:
+/// , ,
+/// and .
+///
+///
+/// When a DataGridView is attached, the manager perform the following actions:
+///
+///
+/// it creates a filter host, that is an instance of the DgvFilterHost class. If you
+/// previously provided a
+/// filter host, this step is skipped.
+///
+///
+/// it creates an array of DgvBaseColumnFilter, one per column, and initializes each element to a
+/// specialization
+/// of DgvBaseColumnFilter. If is false, this step
+/// is skipped.
+///
+///
+///
+///
+/// You can force a specific column filter for a certain column, intervening in this process through the
+/// events
+/// and . You
+/// can also intervene, after the entire process, replacing
+/// a column filter instance in the array with another instance you created.
+///
+///
+public class DgvFilterManager
+{
+ #region PRIVATE FIELDS
+
+ private DgvBaseFilterHost mFilterHost; // The host UserControl to popup
+ private DataGridView mDataGridView; // The DataGridView to which apply filtering
+ private DataView mBoundDataView; // The DataView to which the DataGridView is bound
+ private BindingSource mBindingSource; // The BindingSource, if any, to which the DataGridView is bound
+
+
+ private string mBaseFilter = ""; // Developer provided filter expression
+ private int mCurrentColumnIndex = -1; // Column Index of currently visibile filter
+
+ private List mColumnFilterList; // List of ColumnFilter objects
+ private bool mFilterIsActive;
+
+ #endregion
+
+
+ #region EVENTS
+
+ ///
+ /// Occurs when a column filter instance for a column is about to be automatically created.
+ ///
+ ///
+ /// Using this event you can set the
+ /// property to force the specialization to use for the
+ /// column.
+ /// This event is raised only if is true.
+ ///
+ public event ColumnFilterEventHandler ColumnFilterAdding;
+
+
+ ///
+ /// Occurs when a column filter instance is created.
+ /// This event is raised only if is true.
+ ///
+ public event ColumnFilterEventHandler ColumnFilterAdded;
+
+
+ ///
+ /// Occurs when the popup is about to be shown
+ ///
+ ///
+ /// Use this event to customize the popup position. Set the Handled property of the event argument to true.
+ ///
+ public event ColumnFilterEventHandler PopupShowing;
+
+ #endregion
+
+
+ #region CONSTRUCTORS
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvFilterManager()
+ {
+ }
+
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The DataGridView to which attach filtering capabilities
+ /// if set to true automatically creates a column filter for each column
+ public DgvFilterManager(DataGridView dataGridView, bool autoCreateFilters)
+ {
+ AutoCreateFilters = autoCreateFilters;
+ DataGridView = dataGridView;
+ }
+
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The DataGridView to which attach filtering capabilities.
+ public DgvFilterManager(DataGridView dataGridView) : this(dataGridView, true)
+ {
+ }
+
+ #endregion
+
+
+ #region PROPERTIES
+
+ ///
+ /// Gets or sets a value indicating whether the manager must create column filters.
+ ///
+ /// true by default.
+ public bool AutoCreateFilters { get; set; } = true;
+
+
+ ///
+ /// Gets and sets the filter host to use.
+ ///
+ ///
+ /// The default filter host is an instance of
+ ///
+
+ public DgvBaseFilterHost FilterHost
+ {
+ get
+ {
+ if (mFilterHost == null)
+ // If not provided, use the default FilterHost
+ FilterHost = new DgvFilterHost();
+ return mFilterHost;
+ }
+ set
+ {
+ mFilterHost = value;
+ // initialize FilterManager to this object
+ mFilterHost.FilterManager = this;
+ mFilterHost.Popup.Closed += Popup_Closed;
+ }
+ }
+
+
+ ///
+ /// Gets and sets the DataGridView to which apply filtering capabilities.
+ ///
+ ///
+ ///
+ /// When a DataGridView is attached, the manager perform the following actions:
+ ///
+ ///
+ /// it creates a filter host, that is an instance of the DgvFilterHost class. If you
+ /// previously provided a
+ /// filter host, this step is skipped.
+ ///
+ ///
+ /// it creates an array of DgvBaseColumnFilter, one per column, and initializes each element to a
+ /// specialization
+ /// of DgvBaseColumnFilter. If is false, this step
+ /// is skipped.
+ ///
+ ///
+ ///
+ ///
+ /// You can force a specific column filter for a certain column, intervening in this process through the
+ /// events
+ /// and . You
+ /// can also intervene, after the entire process, replacing
+ /// a column filter instance in the array with another instance you created.
+ ///
+ ///
+ public DataGridView DataGridView
+ {
+ get => mDataGridView;
+ set
+ {
+ mDataGridView = value;
+ mColumnFilterList = new List(mDataGridView.Columns.Count);
+ FindDataView();
+ mDataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ mDataGridView.CellMouseClick += mDataGridView_CellMouseClick;
+ mDataGridView.CellPainting += mDataGridView_CellPainting;
+ mDataGridView.ColumnAdded += mDataGridView_ColumnAdded;
+ mDataGridView.ColumnRemoved += mDataGridView_ColumnRemoved;
+ if (mDataGridView == null) return;
+ foreach (DataGridViewColumn c in mDataGridView.Columns)
+ {
+ mColumnFilterList.Add(null);
+ CreateColumnFilter(c);
+ }
+ }
+ }
+
+ ///
+ /// Gets and sets developer provided filter expression. This expression
+ /// will be "merged" with end-user created filters.
+ ///
+ /// The base filter.
+
+ public string BaseFilter
+ {
+ get => mBaseFilter;
+ set
+ {
+ mBaseFilter = value;
+ RebuildFilter();
+ }
+ }
+
+
+ ///
+ /// Gets or sets the column filter control related to the ColumnIndex
+ ///
+ /// The index of the DataGridView column
+ /// the DgvBaseColumnFilter related to the DataGridView column
+ ///
+ /// This indexer allow you to get and set the column filter instance for the column.
+ /// You can set one of the standard column filter implementation or an instance
+ /// of your own DgvBaseFilterColumn specialization.
+ ///
+ public DgvBaseColumnFilter this[int ColumnIndex]
+ {
+ get => mColumnFilterList[ColumnIndex];
+ set
+ {
+ mColumnFilterList[ColumnIndex] = value;
+ value.Init(this, FilterHost, mDataGridView.Columns[ColumnIndex], mBoundDataView);
+ }
+ }
+
+
+ ///
+ /// Gets or sets the column filter control related to the ColumnName
+ ///
+ /// The name of the DataGridView column
+ /// the DgvBaseColumnFilter related to the DataGridView column
+ ///
+ /// This indexer allow you to get and set the column filter instance for the column.
+ /// You can set one of the standard column filter implementation or an instance
+ /// of your own DgvBaseFilterColumn specialization.
+ ///
+ public DgvBaseColumnFilter this[string ColumnName]
+ {
+ get => mColumnFilterList[mDataGridView.Columns[ColumnName].Index];
+ set => this[mDataGridView.Columns[ColumnName].Index] = value;
+ }
+
+ #endregion
+
+
+ #region DATAGRIDVIEW EVENT HANDLERS
+
+ private void mDataGridView_ColumnRemoved(object sender, DataGridViewColumnEventArgs e)
+ {
+ mColumnFilterList.RemoveAt(e.Column.Index);
+ }
+
+ private void mDataGridView_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
+ {
+ FindDataView();
+ mColumnFilterList.Insert(e.Column.Index, null);
+ CreateColumnFilter(e.Column);
+ }
+
+
+ ///
+ /// Shows the popup when user right-clicks a column header
+ ///
+ /// The event source.
+ ///
+ /// The instance containing the event
+ /// data.
+ ///
+ protected virtual void mDataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Right && e.RowIndex == -1 && e.ColumnIndex > -1) ShowPopup(e.ColumnIndex);
+ }
+
+ //Based on filters state, call the appropriate protected paint helpers
+ private void mDataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
+ {
+ if (e.RowIndex != -1) return; //skip if it is not the header row
+
+ //Cell Origin
+ if (e.RowIndex == -1 && e.ColumnIndex == -1 && mFilterIsActive)
+ {
+ OnFilteredGridPaint(sender, e);
+ return;
+ }
+
+ if (FilterHost.Popup.Visible) OnHighlightedColumnPaint(sender, e);
+
+ if (e.ColumnIndex == -1) return;
+ if (mColumnFilterList[e.ColumnIndex] != null && mColumnFilterList[e.ColumnIndex].Active)
+ OnFilteredColumnPaint(sender, e);
+ }
+
+
+ ///
+ /// Paints a funnel icon in the cell origin when some column is filtered.
+ ///
+ /// The sender
+ ///
+ /// The instance containing the event
+ /// data.
+ ///
+ ///
+ /// Override this method to provide your own painting
+ ///
+ protected virtual void OnFilteredGridPaint(object sender, DataGridViewCellPaintingEventArgs e)
+ {
+ e.Graphics.FillRectangle(Brushes.White, e.CellBounds);
+ e.Paint(e.CellBounds, e.PaintParts & ~DataGridViewPaintParts.Background);
+ var r = new Rectangle(e.CellBounds.X + 1, e.CellBounds.Y + 1, e.CellBounds.Width - 3, e.CellBounds.Height - 4);
+ e.Graphics.DrawImage(FunnelPicture, (e.CellBounds.Width - FunnelPicture.Width) / 2,
+ (e.CellBounds.Height - FunnelPicture.Height) / 2, FunnelPicture.Width, FunnelPicture.Height);
+ e.Graphics.DrawRectangle(Pens.Black, r);
+
+ e.Handled = true;
+
+ //e.Paint(e.CellBounds, DataGridViewPaintParts.All);
+ //e.Graphics.DrawImage(FunnelPicture, (e.CellBounds.Width - FunnelPicture.Width) / 2, (e.CellBounds.Height - FunnelPicture.Height) / 2, FunnelPicture.Width, FunnelPicture.Height);
+ //e.Handled = true;
+ }
+
+ ///
+ /// Performs customized column header painting when the popup is visibile.
+ ///
+ /// The sender.
+ ///
+ /// The instance containing the event
+ /// data.
+ ///
+ ///
+ /// Override this method to provide your own painting
+ ///
+ protected virtual void OnHighlightedColumnPaint(object sender, DataGridViewCellPaintingEventArgs e)
+ {
+ if (e.ColumnIndex != mCurrentColumnIndex || e.RowIndex != -1) return;
+ e.Paint(e.CellBounds, DataGridViewPaintParts.All);
+ var r = new Rectangle(e.CellBounds.X + 1, e.CellBounds.Y + 1, e.CellBounds.Width - 3, e.CellBounds.Height - 4);
+ e.Graphics.DrawRectangle(Pens.Yellow, r);
+ e.Handled = true;
+ }
+
+ ///
+ /// Performs customized column header painting when the column is filtered.
+ ///
+ /// The sender.
+ ///
+ /// The instance containing the event
+ /// data.
+ ///
+ ///
+ /// Override this method to provide your own painting
+ ///
+ protected virtual void OnFilteredColumnPaint(object sender, DataGridViewCellPaintingEventArgs e)
+ {
+ e.Graphics.FillRectangle(Brushes.White, e.CellBounds);
+ e.Paint(e.CellBounds, e.PaintParts & ~DataGridViewPaintParts.Background);
+ var r = new Rectangle(e.CellBounds.X + 1, e.CellBounds.Y + 1, e.CellBounds.Width - 3, e.CellBounds.Height - 4);
+ e.Graphics.DrawRectangle(Pens.Black, r);
+ e.Handled = true;
+ }
+
+ #endregion
+
+
+ #region FILTERHOST MANAGING
+
+ //Forces column header repaint when popup is closed, cleaning customized painting performed by OnHighlightedColumnPaint
+ private void Popup_Closed(object sender, ToolStripDropDownClosedEventArgs e)
+ {
+ mDataGridView.InvalidateCell(mCurrentColumnIndex,
+ -1); // Force header repaint (to hide the selection yellow frame)
+ }
+
+
+ ///
+ /// Shows the popup.
+ ///
+ /// Index of the column.
+ public void ShowPopup(int ColumnIndex)
+ {
+ if (mColumnFilterList[ColumnIndex] == null) return; // non-data column
+ var OldColumnIndex = mCurrentColumnIndex;
+ mCurrentColumnIndex = ColumnIndex;
+ var r = mDataGridView.GetCellDisplayRectangle(ColumnIndex, -1, false); // get the header size info
+ FilterHost.CurrentColumnFilter = mColumnFilterList[ColumnIndex];
+ try
+ {
+ //use "try" because old column could have been removed
+ mDataGridView.InvalidateCell(OldColumnIndex, -1);
+ }
+ catch
+ {
+ }
+
+ var e = new ColumnFilterEventArgs(mDataGridView.Columns[ColumnIndex], mColumnFilterList[ColumnIndex]);
+ if (PopupShowing != null) PopupShowing(this, e);
+ if (!e.Handled)
+ FilterHost.Popup.Show(mDataGridView, r.X + r.Width - 4,
+ r.Y - 10); // show the filterhost popup near the column
+ FilterHost.Popup.Focus();
+
+ mDataGridView.InvalidateCell(mCurrentColumnIndex,
+ -1); // Force header repaint (to show a selection yellow frame)
+ }
+
+ #endregion
+
+
+ #region COLUMN FILTERS MANAGING
+
+ ///
+ /// Activates / Deactivates the filter for the column specified by ColumnIndex.
+ ///
+ /// The active state to set
+ /// Index of the column.
+ public void ActivateFilter(bool Active, int ColumnIndex)
+ {
+ this[ColumnIndex].Active = Active;
+ RebuildFilter();
+ }
+
+
+ ///
+ /// Activates / Deactivates the filter for the column specified by ColumnName.
+ ///
+ /// The active state to set
+ /// Name of the column.
+ public void ActivateFilter(bool Active, string ColumnName)
+ {
+ this[ColumnName].Active = Active;
+ RebuildFilter();
+ }
+
+
+ ///
+ /// Activates / Deactivates the filter for the current, that is last right-clicked, column.
+ ///
+ /// The active state to set
+ public void ActivateFilter(bool Active)
+ {
+ if (mCurrentColumnIndex == -1) return;
+ this[mCurrentColumnIndex].Active = Active;
+ if (Active) this[mCurrentColumnIndex].FilterExpressionBuild();
+ RebuildFilter();
+ }
+
+
+ ///
+ /// Activates / Deactivates all filters.
+ ///
+ /// The active state to set
+ public void ActivateAllFilters(bool Active)
+ {
+ foreach (var CF in mColumnFilterList)
+ {
+ if (CF == null) continue;
+ CF.Active = Active;
+ if (Active) CF.FilterExpressionBuild();
+ }
+
+ RebuildFilter();
+ }
+
+
+ ///
+ /// Rebuilds the whole filter expression.
+ ///
+ ///
+ /// The whole filter expression is the conjunction of each column filter and the .
+ /// Call this method to refresh and apply the whole filter expression.
+ ///
+ public void RebuildFilter()
+ {
+ mFilterIsActive = false;
+ var Filter = "";
+ foreach (var CF in mColumnFilterList)
+ {
+ if (CF == null) continue;
+ if (CF.Active && CF.FilterExpression != "")
+ {
+ Filter += " AND (" + CF.FilterExpression + ")";
+ CF.DataGridViewColumn.HeaderText = CF.FilterCaption;
+ }
+ else
+ {
+ CF.DataGridViewColumn.HeaderText = CF.OriginalDataGridViewColumnHeaderText;
+ }
+ }
+
+ if (Filter != "")
+ {
+ mFilterIsActive = true;
+ Filter = mBaseFilter == "" ? "1=1 " + Filter : mBaseFilter + " " + Filter;
+ }
+ else
+ {
+ Filter = mBaseFilter;
+ }
+
+ // Apply the filter only if any changes occurred
+ try
+ {
+ if (mBindingSource != null)
+ {
+ if (mBindingSource.Filter != Filter) mBindingSource.Filter = Filter;
+ }
+ else
+ {
+ if (mBoundDataView.RowFilter != Filter) mBoundDataView.RowFilter = Filter;
+ }
+ }
+ catch
+ {
+ Console.WriteLine("Invalid filter: " + Filter);
+ }
+ }
+
+ #endregion
+
+
+ #region HELPERS
+
+ // Checks if the DataGridView is data bound and the data source finally resolves to a DataView.
+ private void FindDataView()
+ {
+ mBindingSource = null;
+ var DataSource = mDataGridView.DataSource;
+ var DataMember = mDataGridView.DataMember;
+
+ var ExceptionMsg =
+ "DataGridViewFilter can only work with bound DataGridView. The DataSource must be a DataSet, a DataTable, a DataView or a BindingSource which is bound to a DataSet, a DataTable or a DataView ";
+
+ while (!(DataSource is DataView))
+ {
+ if (DataSource == null) return;
+
+ if (DataSource is BindingSource)
+ {
+ mBindingSource = (BindingSource)DataSource;
+ DataMember = ((BindingSource)DataSource).DataMember;
+ DataSource = ((BindingSource)DataSource).DataSource;
+ continue;
+ }
+
+ if (DataSource is DataSet)
+ {
+ DataSource = ((DataSet)DataSource).Tables[DataMember];
+ DataMember = "";
+ continue;
+ }
+
+ if (DataSource is DataTable)
+ {
+ DataSource = ((DataTable)DataSource).DefaultView;
+ break;
+ }
+
+ //other types are not allowed
+ throw new Exception(ExceptionMsg);
+ }
+
+ mBoundDataView = (DataView)DataSource;
+ }
+
+ ///
+ /// Gets a funnel picture.
+ ///
+ public static Image FunnelPicture => Resources.Filter_16x;
+
+
+ private void CreateColumnFilter(DataGridViewColumn c)
+ {
+ if (!AutoCreateFilters) return;
+ //Raise the event about column filter creation
+ var e = new ColumnFilterEventArgs(c, null);
+ if (ColumnFilterAdding != null) ColumnFilterAdding(this, e);
+ //if not provided, by an event handler, proceed with standard filter creation
+ if (e.ColumnFilter == null)
+ {
+ Type DataType = null;
+ if (c.DataPropertyName != "")
+ {
+ DataType = mBoundDataView.Table.Columns[c.DataPropertyName].DataType;
+
+ switch (c.GetType().Name)
+ {
+ case "DataGridViewComboBoxColumn":
+ e.ColumnFilter = new DgvComboBoxColumnFilter();
+ break;
+ case "DataGridViewCheckBoxColumn":
+ e.ColumnFilter = new DgvCheckBoxColumnFilter();
+ break;
+ case "DataGridViewTextBoxColumn":
+ if (DataType == typeof(DateTime))
+ e.ColumnFilter = new DgvDateColumnFilter();
+ else
+ e.ColumnFilter = new DgvTextBoxColumnFilter();
+ break;
+ }
+ }
+ }
+
+ mColumnFilterList[c.Index] = e.ColumnFilter;
+ if (e.ColumnFilter != null)
+ {
+ // == null when non-data column
+ if (ColumnFilterAdded != null) ColumnFilterAdded(this, e);
+ e.ColumnFilter.Init(this, FilterHost, c, mBoundDataView);
+ }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.Designer.cs
new file mode 100644
index 0000000..c815006
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.Designer.cs
@@ -0,0 +1,71 @@
+namespace DgvFilterPopup {
+ partial class DgvDateRangeColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.DateTimePickerValue = new System.Windows.Forms.DateTimePicker();
+ this.DateTimePickerValue2 = new System.Windows.Forms.DateTimePicker();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(49, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // dateTimePickerValue
+ //
+ this.DateTimePickerValue.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+ this.DateTimePickerValue.Location = new System.Drawing.Point(58, 3);
+ this.DateTimePickerValue.Name = "DateTimePickerValue";
+ this.DateTimePickerValue.Size = new System.Drawing.Size(127, 20);
+ this.DateTimePickerValue.TabIndex = 1;
+ //
+ // dateTimePickerValueUntil
+ //
+ this.DateTimePickerValue2.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+ this.DateTimePickerValue2.Location = new System.Drawing.Point(58, 29);
+ this.DateTimePickerValue2.Name = "dateTimePickerValueUntil";
+ this.DateTimePickerValue2.Size = new System.Drawing.Size(127, 20);
+ this.DateTimePickerValue2.TabIndex = 2;
+ //
+ // DgvDateRangeColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.DateTimePickerValue2);
+ this.Controls.Add(this.DateTimePickerValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvDateRangeColumnFilter";
+ this.Size = new System.Drawing.Size(191, 54);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.cs
new file mode 100644
index 0000000..1e3b578
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.cs
@@ -0,0 +1,130 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// An extended column filter implementation allowing filters on date ranges.
+///
+public partial class DgvDateRangeColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvDateRangeColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ DateTimePickerValue.TextChanged += onFilterChanged;
+ DateTimePickerValue2.TextChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+
+ ///
+ /// Gets the DateTimePicker control containing the date value.
+ ///
+ public DateTimePicker DateTimePickerValue { get; private set; }
+
+ ///
+ /// Gets the DateTimePicker control containing the second date value.
+ ///
+ public DateTimePicker DateTimePickerValue2 { get; private set; }
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxOperator.Items.AddRange(new object[] { "[...]", "=", "<>", ">", "<", "<=", ">=", "= �", "<> �" });
+ ComboBoxOperator.SelectedIndex = 0;
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ }
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+ var ResultFilterCaption = OriginalDataGridViewColumnHeaderText;
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var FormattedValue = "";
+ var FormattedValueUntil = "";
+
+ FormattedValue = FormatValue(DateTimePickerValue.Value, ColumnDataType);
+ FormattedValueUntil = FormatValue(DateTimePickerValue2.Value.AddDays(1), ColumnDataType);
+
+ if (ComboBoxOperator.Text == "[...]")
+ {
+ FilterExpression = DataGridViewColumn.DataPropertyName + ">=" + FormattedValue
+ + " AND " + DataGridViewColumn.DataPropertyName + "<" + FormattedValueUntil;
+
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = [" + DateTimePickerValue.Text + " , " +
+ DateTimePickerValue2.Text + "]";
+ }
+ else
+ {
+ FilterExpression = DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + FormattedValue;
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n" + ComboBoxOperator.Text + " " +
+ DateTimePickerValue.Text;
+ }
+
+ FilterManager.RebuildFilter();
+ }
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (sender == ComboBoxOperator) DateTimePickerValue2.Visible = ComboBoxOperator.Text == "[...]";
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.resx b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvDateRangeColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.Designer.cs
new file mode 100644
index 0000000..95927f6
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.Designer.cs
@@ -0,0 +1,68 @@
+namespace DgvFilterPopup {
+
+ ///
+ /// An extended column filter implementation allowing filters on date, using months and years.
+ ///
+ partial class DgvMonthYearColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxYear = new System.Windows.Forms.ComboBox();
+ this.ComboBoxMonth = new System.Windows.Forms.ComboBox();
+ this.SuspendLayout();
+ //
+ // comboBoxYear
+ //
+ this.ComboBoxYear.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.ComboBoxYear.FormattingEnabled = true;
+ this.ComboBoxYear.Location = new System.Drawing.Point(102, 3);
+ this.ComboBoxYear.Name = "ComboBoxYear";
+ this.ComboBoxYear.Size = new System.Drawing.Size(78, 21);
+ this.ComboBoxYear.TabIndex = 3;
+ //
+ // comboBoxMonth
+ //
+ this.ComboBoxMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.ComboBoxMonth.FormattingEnabled = true;
+ this.ComboBoxMonth.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxMonth.MaxDropDownItems = 13;
+ this.ComboBoxMonth.Name = "ComboBoxMonth";
+ this.ComboBoxMonth.Size = new System.Drawing.Size(93, 21);
+ this.ComboBoxMonth.TabIndex = 2;
+ //
+ // DgvMonthYearColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.ComboBoxYear);
+ this.Controls.Add(this.ComboBoxMonth);
+ this.Name = "DgvMonthYearColumnFilter";
+ this.Size = new System.Drawing.Size(188, 27);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.cs
new file mode 100644
index 0000000..eeec977
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.cs
@@ -0,0 +1,167 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+public partial class DgvMonthYearColumnFilter : DgvBaseColumnFilter
+{
+ private int mYearMax;
+ private int mYearMin;
+
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvMonthYearColumnFilter()
+ {
+ InitializeComponent();
+ mYearMin = DateTime.Today.Year - 10;
+ mYearMax = DateTime.Today.Year;
+ //Month combo initializing
+ ComboBoxMonth.Items.Add("---");
+ ComboBoxMonth.Items.AddRange(MonthCsvList.Split(','));
+ ComboBoxMonth.SelectedIndex = 0;
+
+ //Year combo initializing
+ mYearMin = DateTime.Today.Year - 10;
+ mYearMax = DateTime.Today.Year;
+ SetYearList();
+ }
+
+ ///
+ /// Gets the ComboBox control containing the months list.
+ ///
+ public ComboBox ComboBoxMonth { get; private set; }
+
+
+ ///
+ /// Gets the ComboBox control containing the years list.
+ ///
+ public ComboBox ComboBoxYear { get; private set; }
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxMonth.SelectedValueChanged += onFilterChanged;
+ ComboBoxYear.SelectedValueChanged += onFilterChanged;
+ ComboBoxYear.SelectedIndex = ComboBoxYear.Items.Count - 1;
+ FilterHost.RegisterComboBox(ComboBoxMonth);
+ FilterHost.RegisterComboBox(ComboBoxYear);
+ }
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ DateTime MinDate, MaxDate;
+
+ if (ComboBoxMonth.SelectedIndex == 0)
+ {
+ MinDate = new DateTime(mYearMin + ComboBoxYear.SelectedIndex, 1, 1, 0, 0, 0);
+ MaxDate = MinDate.AddYears(1);
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = " + ComboBoxYear.Text;
+ }
+ else
+ {
+ MinDate = new DateTime(mYearMin + ComboBoxYear.SelectedIndex, ComboBoxMonth.SelectedIndex, 1, 0, 0, 0);
+ MaxDate = MinDate.AddMonths(1);
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = " + ComboBoxMonth.Text + " " +
+ ComboBoxYear.Text;
+ }
+
+ FilterExpression = DataGridViewColumn.DataPropertyName + " >= " + FormatValue(MinDate, ColumnDataType) +
+ " AND " + DataGridViewColumn.DataPropertyName + " < " + FormatValue(MaxDate, ColumnDataType);
+ FilterManager.RebuildFilter();
+ }
+
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+
+
+ private void SetYearList()
+ {
+ ComboBoxYear.Items.Clear();
+ for (var y = mYearMin; y <= mYearMax; y++) ComboBoxYear.Items.Add(y.ToString());
+ ComboBoxYear.SelectedIndex = ComboBoxYear.Items.Count - 1;
+ }
+
+
+ #region PROPERTIES
+
+ ///
+ /// Gets or sets the month comma separated list.
+ ///
+ /// The month CSV list.
+ ///
+ /// Allows you to set once your culture-specific comma separated list of months.
+ ///
+ public static string MonthCsvList { get; set; } =
+ "January,February,March,April,May,June,July,August,September,October,November,December";
+
+ ///
+ /// Gets or sets the minimum year shown in the years combo.
+ ///
+ /// The year min.
+ public int YearMin
+ {
+ get => mYearMin;
+ set
+ {
+ mYearMin = value;
+ SetYearList();
+ }
+ }
+
+ ///
+ /// Gets or sets the maximum year shown in the years combo.
+ ///
+ /// The year min.
+ public int YearMax
+ {
+ get => mYearMax;
+ set
+ {
+ mYearMax = value;
+ SetYearList();
+ }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.resx b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvMonthYearColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.Designer.cs
new file mode 100644
index 0000000..938dd49
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.Designer.cs
@@ -0,0 +1,70 @@
+namespace DgvFilterPopup {
+ partial class DgvNumRangeColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.TextBoxValue = new System.Windows.Forms.TextBox();
+ this.TextBoxValue2 = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(55, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // textBoxValue
+ //
+ this.TextBoxValue.Location = new System.Drawing.Point(64, 3);
+ this.TextBoxValue.Name = "TextBoxValue";
+ this.TextBoxValue.Size = new System.Drawing.Size(71, 20);
+ this.TextBoxValue.TabIndex = 1;
+ //
+ // textBoxValue2
+ //
+ this.TextBoxValue2.Location = new System.Drawing.Point(64, 29);
+ this.TextBoxValue2.Name = "TextBoxValue2";
+ this.TextBoxValue2.Size = new System.Drawing.Size(71, 20);
+ this.TextBoxValue2.TabIndex = 2;
+ //
+ // DgvNumRangeColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.TextBoxValue2);
+ this.Controls.Add(this.TextBoxValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvNumRangeColumnFilter";
+ this.Size = new System.Drawing.Size(139, 54);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.cs b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.cs
new file mode 100644
index 0000000..cd2eb3e
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.cs
@@ -0,0 +1,133 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// An extended column filter implementation allowing filters on numeric ranges.
+///
+public partial class DgvNumRangeColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvNumRangeColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ TextBoxValue.TextChanged += onFilterChanged;
+ TextBoxValue2.TextChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+ ///
+ /// Gets the TextBox control containing the first value.
+ ///
+ public TextBox TextBoxValue { get; private set; }
+
+
+ ///
+ /// Gets the TextBox control containing the second value.
+ ///
+ public TextBox TextBoxValue2 { get; private set; }
+
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxOperator.Items.AddRange(new object[] { "[...]", "=", "<>", ">", "<", "<=", ">=", "= �", "<> �" });
+ ComboBoxOperator.SelectedIndex = 0;
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ }
+
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var FormattedValue = FormatValue(TextBoxValue.Text, ColumnDataType);
+ var FormattedValue2 = FormatValue(TextBoxValue2.Text, ColumnDataType);
+
+ if (ComboBoxOperator.Text == "[...]")
+ {
+ if (FormattedValue != "" && FormattedValue2 != "")
+ {
+ FilterExpression = DataGridViewColumn.DataPropertyName + ">=" + FormattedValue
+ + " AND " + DataGridViewColumn.DataPropertyName + "<=" + FormattedValue2;
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = [" + TextBoxValue.Text + " , " +
+ TextBoxValue2.Text + "]";
+ FilterManager.RebuildFilter();
+ }
+ }
+ else
+ {
+ if (FormattedValue != "")
+ {
+ FilterExpression = DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + FormattedValue;
+ FilterCaption = OriginalDataGridViewColumnHeaderText + "\n" + ComboBoxOperator.Text + " " +
+ TextBoxValue.Text;
+ FilterManager.RebuildFilter();
+ }
+ }
+ }
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (sender == ComboBoxOperator) TextBoxValue2.Visible = ComboBoxOperator.Text == "[...]";
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.resx b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Extensions/DgvNumRangeColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.Designer.cs
new file mode 100644
index 0000000..21d15cb
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.Designer.cs
@@ -0,0 +1,63 @@
+namespace DgvFilterPopup {
+ partial class DgvCheckBoxColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.CheckBoxValue = new System.Windows.Forms.CheckBox();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(49, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // checkBoxValue
+ //
+ this.CheckBoxValue.AutoSize = true;
+ this.CheckBoxValue.Location = new System.Drawing.Point(67, 7);
+ this.CheckBoxValue.Name = "CheckBoxValue";
+ this.CheckBoxValue.Size = new System.Drawing.Size(15, 14);
+ this.CheckBoxValue.TabIndex = 1;
+ this.CheckBoxValue.UseVisualStyleBackColor = true;
+ //
+ // DgvCheckBoxColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.CheckBoxValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvCheckBoxColumnFilter";
+ this.Size = new System.Drawing.Size(98, 28);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.cs
new file mode 100644
index 0000000..72585cb
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.cs
@@ -0,0 +1,121 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// A standard column filter implementation for checkbox columns.
+///
+public partial class DgvCheckBoxColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvCheckBoxColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ CheckBoxValue.CheckStateChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+
+ ///
+ /// Gets the CheckBox control containing the checked value.
+ ///
+ public CheckBox CheckBoxValue { get; private set; }
+
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxOperator.Items.AddRange(new object[] { "=", "= �", "<> �" });
+ ComboBoxOperator.SelectedIndex = 0;
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ }
+
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+ var ResultFilterCaption = OriginalDataGridViewColumnHeaderText;
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ if (CheckBoxValue.Checked)
+ {
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " = 1";
+ ResultFilterCaption += "\n = yes";
+ }
+ else
+ {
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " = 0";
+ ResultFilterCaption += "\n = no";
+ }
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption;
+ FilterManager.RebuildFilter();
+ }
+ }
+
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.resx b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvCheckBoxColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.Designer.cs
new file mode 100644
index 0000000..65d1e7d
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.Designer.cs
@@ -0,0 +1,64 @@
+namespace DgvFilterPopup {
+ partial class DgvComboBoxColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.ComboBoxValue = new System.Windows.Forms.ComboBox();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(49, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // comboBoxValue
+ //
+ this.ComboBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.ComboBoxValue.FormattingEnabled = true;
+ this.ComboBoxValue.Location = new System.Drawing.Point(58, 3);
+ this.ComboBoxValue.Name = "ComboBoxValue";
+ this.ComboBoxValue.Size = new System.Drawing.Size(215, 21);
+ this.ComboBoxValue.TabIndex = 1;
+ //
+ // DgvComboBoxColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.ComboBoxValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvComboBoxColumnFilter";
+ this.Size = new System.Drawing.Size(276, 30);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.cs
new file mode 100644
index 0000000..ac8ea14
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.cs
@@ -0,0 +1,165 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// A standard column filter implementation for ComboBox columns.
+///
+///
+/// If the DataGridView column to which this column filter is applied
+/// is not a ComboBox column, it automatically creates a distinct list of values from the bound DataView column.
+/// If the DataView changes, you should do an explicit call to
+/// method.
+///
+public partial class DgvComboBoxColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvComboBoxColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ ComboBoxValue.SelectedValueChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+
+ ///
+ /// Gets the ComboBox control containing the available values.
+ ///
+ public ComboBox ComboBoxValue { get; private set; }
+
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxOperator.Items.AddRange(new object[] { "=", "<>", "= �", "<> �" });
+ ComboBoxOperator.SelectedIndex = 0;
+ if (DataGridViewColumn is DataGridViewComboBoxColumn)
+ {
+ ComboBoxValue.ValueMember = ((DataGridViewComboBoxColumn)DataGridViewColumn).ValueMember;
+ ComboBoxValue.DisplayMember = ((DataGridViewComboBoxColumn)DataGridViewColumn).DisplayMember;
+ ComboBoxValue.DataSource = ((DataGridViewComboBoxColumn)DataGridViewColumn).DataSource;
+ }
+ else
+ {
+ ComboBoxValue.ValueMember = DataGridViewColumn.DataPropertyName;
+ ComboBoxValue.DisplayMember = DataGridViewColumn.DataPropertyName;
+ RefreshValues();
+ }
+
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ FilterHost.RegisterComboBox(ComboBoxValue);
+ }
+
+ ///
+ /// For non-combobox columns, refreshes the list of the DataView values in the column.
+ ///
+ public void RefreshValues()
+ {
+ if (!(DataGridViewColumn is DataGridViewComboBoxColumn))
+ {
+ var DistinctDataTable = BoundDataView.ToTable(true, DataGridViewColumn.DataPropertyName);
+ DistinctDataTable.DefaultView.Sort = DataGridViewColumn.DataPropertyName;
+ ComboBoxValue.DataSource = DistinctDataTable;
+ }
+ }
+
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+ var ResultFilterCaption = OriginalDataGridViewColumnHeaderText;
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var FilterValue = ComboBoxValue.SelectedValue;
+ var FormattedValue = "";
+
+ if (ColumnDataType == typeof(string))
+ {
+ // Managing the string-column case
+ var EscapedFilterValue = StringEscape(FilterValue.ToString());
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + "'" +
+ EscapedFilterValue + "'";
+ ResultFilterCaption += "\n" + ComboBoxOperator.Text + " " + ComboBoxValue.Text;
+ }
+ else
+ {
+ // Managing the other cases
+ FormattedValue = FormatValue(FilterValue, ColumnDataType);
+ if (FormattedValue != "")
+ {
+ ResultFilterExpression =
+ DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + FormattedValue;
+ ResultFilterCaption += "\n" + ComboBoxOperator.Text + " " + ComboBoxValue.Text;
+ }
+ }
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption;
+ FilterManager.RebuildFilter();
+ }
+ }
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.resx b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvComboBoxColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.Designer.cs
new file mode 100644
index 0000000..551ab5f
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.Designer.cs
@@ -0,0 +1,61 @@
+namespace DgvFilterPopup {
+ partial class DgvDateColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.DateTimePickerValue = new System.Windows.Forms.DateTimePicker();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(49, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // dateTimePickerValue
+ //
+ this.DateTimePickerValue.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+ this.DateTimePickerValue.Location = new System.Drawing.Point(58, 3);
+ this.DateTimePickerValue.Name = "DateTimePickerValue";
+ this.DateTimePickerValue.Size = new System.Drawing.Size(127, 20);
+ this.DateTimePickerValue.TabIndex = 1;
+ //
+ // DgvDateColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.DateTimePickerValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvDateColumnFilter";
+ this.Size = new System.Drawing.Size(194, 28);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.cs
new file mode 100644
index 0000000..490f893
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.cs
@@ -0,0 +1,118 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// A standard column filter implementation for date columns.
+///
+public partial class DgvDateColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvDateColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ DateTimePickerValue.TextChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+
+ ///
+ /// Gets the DateTimePicker control containing the date value.
+ ///
+ public DateTimePicker DateTimePickerValue { get; private set; }
+
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+ ComboBoxOperator.Items.AddRange(new object[] { "=", "<>", ">", "<", "<=", ">=", "= �", "<> �" });
+ ComboBoxOperator.SelectedIndex = 0;
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ }
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+ var ResultFilterCaption = OriginalDataGridViewColumnHeaderText;
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ object FilterValue = DateTimePickerValue.Value;
+ var FormattedValue = "";
+
+ FormattedValue = FormatValue(FilterValue, ColumnDataType);
+ if (FormattedValue != "")
+ {
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + FormattedValue;
+ ResultFilterCaption += "\n" + ComboBoxOperator.Text + " " + DateTimePickerValue.Text;
+ }
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption;
+ FilterManager.RebuildFilter();
+ }
+ }
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.resx b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvDateColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.Designer.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.Designer.cs
new file mode 100644
index 0000000..ba65bfd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.Designer.cs
@@ -0,0 +1,170 @@
+namespace DgvFilterPopup
+{
+ partial class DgvFilterHost
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.tsRemove = new System.Windows.Forms.ToolStripButton();
+ this.tsOK = new System.Windows.Forms.ToolStripButton();
+ this.tsRemoveAll = new System.Windows.Forms.ToolStripButton();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.lblColumnName = new System.Windows.Forms.Label();
+ this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.panelFilterArea = new System.Windows.Forms.Panel();
+ this.toolStrip1.SuspendLayout();
+ this.panel1.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.SuspendLayout();
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.BackColor = System.Drawing.Color.Transparent;
+ this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsRemove,
+ this.tsOK,
+ this.tsRemoveAll});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 69);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.toolStrip1.Size = new System.Drawing.Size(152, 25);
+ this.toolStrip1.TabIndex = 5;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // tsRemove
+ //
+ this.tsRemove.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tsRemove.Image = global::DgvFilterPopup.Properties.Resources.StopFilter_16x;
+ this.tsRemove.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsRemove.Margin = new System.Windows.Forms.Padding(5, 1, 0, 2);
+ this.tsRemove.Name = "tsRemove";
+ this.tsRemove.Size = new System.Drawing.Size(23, 22);
+ this.tsRemove.Text = "Remove filter";
+ this.tsRemove.ToolTipText = "Remove Filter";
+ this.tsRemove.Click += new System.EventHandler(this.tsRemove_Click);
+ //
+ // tsOK
+ //
+ this.tsOK.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
+ this.tsOK.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tsOK.Image = global::DgvFilterPopup.Properties.Resources.StatusOK_16x;
+ this.tsOK.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsOK.Name = "tsOK";
+ this.tsOK.Size = new System.Drawing.Size(23, 22);
+ this.tsOK.Text = "OK";
+ this.tsOK.Click += new System.EventHandler(this.tsOK_Click);
+ //
+ // tsRemoveAll
+ //
+ this.tsRemoveAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.tsRemoveAll.Image = global::DgvFilterPopup.Properties.Resources.StopFilters_16x;
+ this.tsRemoveAll.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tsRemoveAll.Margin = new System.Windows.Forms.Padding(0);
+ this.tsRemoveAll.Name = "tsRemoveAll";
+ this.tsRemoveAll.Size = new System.Drawing.Size(23, 25);
+ this.tsRemoveAll.Text = "Remove all";
+ this.tsRemoveAll.Click += new System.EventHandler(this.tsRemoveAll_Click);
+ //
+ // panel1
+ //
+ this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.panel1.BackColor = System.Drawing.Color.Gainsboro;
+ this.panel1.Controls.Add(this.lblColumnName);
+ this.panel1.Controls.Add(this.pictureBox1);
+ this.panel1.Location = new System.Drawing.Point(-9, -1);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(162, 24);
+ this.panel1.TabIndex = 10;
+ //
+ // lblColumnName
+ //
+ this.lblColumnName.AutoSize = true;
+ this.lblColumnName.BackColor = System.Drawing.Color.Transparent;
+ this.lblColumnName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblColumnName.Location = new System.Drawing.Point(34, 5);
+ this.lblColumnName.Name = "lblColumnName";
+ this.lblColumnName.Size = new System.Drawing.Size(84, 13);
+ this.lblColumnName.TabIndex = 12;
+ this.lblColumnName.Text = "Column Name";
+ //
+ // pictureBox1
+ //
+ this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
+ this.pictureBox1.Image = global::DgvFilterPopup.Properties.Resources.Filter_16x;
+ this.pictureBox1.Location = new System.Drawing.Point(12, 3);
+ this.pictureBox1.Name = "pictureBox1";
+ this.pictureBox1.Size = new System.Drawing.Size(16, 16);
+ this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
+ this.pictureBox1.TabIndex = 10;
+ this.pictureBox1.TabStop = false;
+ //
+ // panelFilterArea
+ //
+ this.panelFilterArea.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.panelFilterArea.Location = new System.Drawing.Point(3, 26);
+ this.panelFilterArea.Name = "panelFilterArea";
+ this.panelFilterArea.Size = new System.Drawing.Size(146, 40);
+ this.panelFilterArea.TabIndex = 11;
+ //
+ // DgvFilterHost
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.White;
+ this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.Controls.Add(this.panelFilterArea);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.panel1);
+ this.Name = "DgvFilterHost";
+ this.Size = new System.Drawing.Size(152, 94);
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton tsOK;
+ private System.Windows.Forms.ToolStripButton tsRemoveAll;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Label lblColumnName;
+ private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.ToolStripButton tsRemove;
+ private System.Windows.Forms.Panel panelFilterArea;
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.cs
new file mode 100644
index 0000000..6303532
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.cs
@@ -0,0 +1,50 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// Is the standard implementation of DgvBaseFilterHost
+///
+[ToolboxItem(false)]
+public partial class DgvFilterHost : DgvBaseFilterHost
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvFilterHost()
+ {
+ InitializeComponent();
+ CurrentColumnFilterChanged += DgvFilterHost_CurrentColumnFilterChanged;
+ }
+
+ ///
+ /// Return the effective area to which the column filters will be added.
+ ///
+ ///
+ public override Control FilterClientArea => panelFilterArea;
+
+ private void DgvFilterHost_CurrentColumnFilterChanged(object sender, EventArgs e)
+ {
+ lblColumnName.Text = CurrentColumnFilter.OriginalDataGridViewColumnHeaderText;
+ }
+
+ private void tsOK_Click(object sender, EventArgs e)
+ {
+ FilterManager.ActivateFilter(true);
+ Popup.Close();
+ }
+
+ private void tsRemove_Click(object sender, EventArgs e)
+ {
+ FilterManager.ActivateFilter(false);
+ Popup.Close();
+ }
+
+ private void tsRemoveAll_Click(object sender, EventArgs e)
+ {
+ FilterManager.ActivateAllFilters(false);
+ Popup.Close();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.resx b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.resx
new file mode 100644
index 0000000..4a80eaa
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvFilterHost.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.Designer.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.Designer.cs
new file mode 100644
index 0000000..61b7b5d
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.Designer.cs
@@ -0,0 +1,63 @@
+namespace DgvFilterPopup {
+ partial class DgvTextBoxColumnFilter {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing) {
+ if (disposing && (components != null)) {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent() {
+ this.ComboBoxOperator = new System.Windows.Forms.ComboBox();
+ this.TextBoxValue = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // comboBoxOperator
+ //
+ this.ComboBoxOperator.FormattingEnabled = true;
+ this.ComboBoxOperator.Location = new System.Drawing.Point(3, 3);
+ this.ComboBoxOperator.Name = "ComboBoxOperator";
+ this.ComboBoxOperator.Size = new System.Drawing.Size(55, 21);
+ this.ComboBoxOperator.TabIndex = 0;
+ //
+ // textBoxValue
+ //
+ this.TextBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.TextBoxValue.Location = new System.Drawing.Point(64, 3);
+ this.TextBoxValue.Name = "TextBoxValue";
+ this.TextBoxValue.Size = new System.Drawing.Size(142, 20);
+ this.TextBoxValue.TabIndex = 1;
+ //
+ // DgvTextBoxColumnFilter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.BackColor = System.Drawing.Color.Transparent;
+ this.Controls.Add(this.TextBoxValue);
+ this.Controls.Add(this.ComboBoxOperator);
+ this.Name = "DgvTextBoxColumnFilter";
+ this.Size = new System.Drawing.Size(209, 28);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ }
+}
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.cs b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.cs
new file mode 100644
index 0000000..ce540f6
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.cs
@@ -0,0 +1,153 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace DgvFilterPopup;
+
+///
+/// A standard column filter implementation for textbox columns.
+///
+public partial class DgvTextBoxColumnFilter : DgvBaseColumnFilter
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DgvTextBoxColumnFilter()
+ {
+ InitializeComponent();
+ ComboBoxOperator.SelectedValueChanged += onFilterChanged;
+ TextBoxValue.TextChanged += onFilterChanged;
+ }
+
+ ///
+ /// Gets the ComboBox control containing the available operators.
+ ///
+ public ComboBox ComboBoxOperator { get; private set; }
+
+ ///
+ /// Gets the TextBox control containing the value.
+ ///
+ public TextBox TextBoxValue { get; private set; }
+
+
+ ///
+ /// Perform filter initialitazion and raises the FilterInitializing event.
+ ///
+ /// The source of the event.
+ /// The instance containing the event data.
+ ///
+ /// When this column filter control is added to the column filters array of the filter manager,
+ /// the latter calls the method which, in turn, calls this method.
+ /// You can ovverride this method to provide initialization code or you can create an event handler and
+ /// set the Cancel property of event argument to true, to skip standard initialization.
+ ///
+ protected override void OnFilterInitializing(object sender, CancelEventArgs e)
+ {
+ base.OnFilterInitializing(sender, e);
+ if (e.Cancel) return;
+
+ if (ColumnDataType == typeof(string))
+ ComboBoxOperator.Items.AddRange(new object[] { "..xxx..", "xxx..", "..xxx", "=", "<>", "= �", "<> �" });
+ else
+ ComboBoxOperator.Items.AddRange(new object[] { "=", "<>", ">", "<", "<=", ">=", "= �", "<> �" });
+
+ ComboBoxOperator.SelectedIndex = 0;
+ FilterHost.RegisterComboBox(ComboBoxOperator);
+ }
+
+
+ ///
+ /// Builds the filter expression and raises the FilterExpressionBuilding event
+ ///
+ /// The event source.
+ /// The instance containing the event data.
+ ///
+ /// Override OnFilterExpressionBuilding to provide a filter expression construction
+ /// logic and to set the values of the and
+ /// properties.
+ /// The will use these properties in constructing the whole filter expression and to
+ /// change the header text of the filtered column.
+ /// Otherwise, you can create an event handler and set the Cancel property of event argument to true, to skip
+ /// standard filter expression building logic.
+ ///
+ protected override void OnFilterExpressionBuilding(object sender, CancelEventArgs e)
+ {
+ base.OnFilterExpressionBuilding(sender, e);
+ if (e.Cancel)
+ {
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ var ResultFilterExpression = "";
+ var ResultFilterCaption = OriginalDataGridViewColumnHeaderText;
+
+ var FilterValue = TextBoxValue.Text;
+ var FormattedValue = "";
+
+ // Managing the NULL and NOT NULL cases which are type-independent
+ if (ComboBoxOperator.Text == "= �")
+ ResultFilterExpression = GetNullCondition(DataGridViewColumn.DataPropertyName);
+ if (ComboBoxOperator.Text == "<> �")
+ ResultFilterExpression = GetNotNullCondition(DataGridViewColumn.DataPropertyName);
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption + "\n " + ComboBoxOperator.Text;
+ FilterManager.RebuildFilter();
+ return;
+ }
+
+ if (ColumnDataType == typeof(string))
+ {
+ // Managing the string-column case
+ FilterValue = StringEscape(FilterValue);
+ switch (ComboBoxOperator.Text)
+ {
+ case "..xxx..":
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " LIKE '%" + FilterValue + "%'";
+ ResultFilterCaption += "\n = '.." + FilterValue + "..'";
+ break;
+ case "xxx..":
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " LIKE '" + FilterValue + "%'";
+ ResultFilterCaption += "\n = '" + FilterValue + "..'";
+ break;
+ case "..xxx":
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " LIKE '%" + FilterValue + "'";
+ ResultFilterCaption += "\n = '.." + FilterValue + "'";
+ break;
+ default:
+ ResultFilterExpression = DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + "'" +
+ FilterValue + "'";
+ ResultFilterCaption += "\n" + ComboBoxOperator.Text + "'" + FilterValue + "'";
+ break;
+ }
+ }
+ else
+ {
+ // Managing the numeric-column case
+ FormattedValue = FormatValue(FilterValue, ColumnDataType);
+ if (FormattedValue != "")
+ {
+ ResultFilterExpression =
+ DataGridViewColumn.DataPropertyName + " " + ComboBoxOperator.Text + FormattedValue;
+ ResultFilterCaption += "\n" + ComboBoxOperator.Text + "'" + FilterValue + "'";
+ }
+ }
+
+ if (ResultFilterExpression != "")
+ {
+ FilterExpression = ResultFilterExpression;
+ FilterCaption = ResultFilterCaption;
+ FilterManager.RebuildFilter();
+ }
+ }
+
+ private void onFilterChanged(object sender, EventArgs e)
+ {
+ if (!FilterApplySoon || !Visible) return;
+ Active = true;
+ FilterExpressionBuild();
+ }
+}
\ No newline at end of file
diff --git a/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.resx b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DgvFilterPopup/FilterPopup/Implementations/DgvTextBoxColumnFilter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/LICENSE.md b/DgvFilterPopup/LICENSE.md
new file mode 100644
index 0000000..2996cf7
--- /dev/null
+++ b/DgvFilterPopup/LICENSE.md
@@ -0,0 +1,57 @@
+# The Code Project Open License (CPOL) 1.02
+## Preamble
+This License governs Your use of the Work. This License is intended to allow developers to use the Source Code and Executable Files provided as part of the Work in any application in any form.
+
+The main points subject to the terms of the License are:
+
+* Source Code and Executable Files can be used in commercial applications;
+* Source Code and Executable Files can be redistributed; and
+* Source Code can be modified to create derivative works.
+* No claim of suitability, guarantee, or any warranty whatsoever is provided. The software is provided "as-is".
+* The Article accompanying the Work may not be distributed or republished without the Author's consent
+This License is entered between You, the individual or other entity reading or otherwise making use of the Work licensed pursuant to this License and the individual or other entity which offers the Work under the terms of this License ("Author").
+
+## License
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CODE PROJECT OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS CONTAINED HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. IF YOU DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS LICENSE, YOU CANNOT MAKE ANY USE OF THE WORK.
+
+1. **Definitions.**
+ 1. **"Articles"** means, collectively, all articles written by Author which describes how the Source Code and Executable Files for the Work may be used by a user.
+ 2. **"Author"** means the individual or entity that offers the Work under the terms of this License.
+ 3. **"Derivative Work"** means a work based upon the Work or upon the Work and other pre-existing works.
+ 4. **"Executable Files"** refer to the executables, binary files, configuration and any required data files included in the Work.
+ 5. **"Publisher"** means the provider of the website, magazine, CD-ROM, DVD or other medium from or by which the Work is obtained by You.
+ 6. **"Source Code"** refers to the collection of source code and configuration files used to create the Executable Files.
+ 7. **"Standard Version"** refers to such a Work if it has not been modified, or has been modified in accordance with the consent of the Author, such consent being in the full discretion of the Author.
+ 8. **"Work"** refers to the collection of files distributed by the Publisher, including the Source Code, Executable Files, binaries, data files, documentation, whitepapers and the Articles.
+ 9. **"You"** is you, an individual or entity wishing to use the Work and exercise your rights under this License.
+2. **Fair Use/Fair Use Rights.** Nothing in this License is intended to reduce, limit, or restrict any rights arising from fair use, fair dealing, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+3. **License Grant.** Subject to the terms and conditions of this License, the Author hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+ 1. You may use the standard version of the Source Code or Executable Files in Your own applications.
+ 2. You may apply bug fixes, portability fixes and other modifications obtained from the Public Domain or from the Author. A Work modified in such a way shall still be considered the standard version and will be subject to this License.
+ 3. You may otherwise modify Your copy of this Work (excluding the Articles) in any way to create a Derivative Work, provided that You insert a prominent notice in each changed file stating how, when and where You changed that file.
+ 4. You may distribute the standard version of the Executable Files and Source Code or Derivative Work in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution.
+ 5. The Articles discussing the Work published in any form by the author may not be distributed or republished without the Author's consent. The author retains copyright to any such Articles. You may use the Executable Files and Source Code pursuant to this License but you may not repost or republish or otherwise distribute or make available the Articles, without the prior written consent of the Author.
+Any subroutines or modules supplied by You and linked into the Source Code or Executable Files of this Work shall not be considered part of this Work and will not be subject to the terms of this License.
+4. **Patent License.** Subject to the terms and conditions of this License, each Author hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, import, and otherwise transfer the Work.
+5. **Restrictions.** The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+ 1. You agree not to remove any of the original copyright, patent, trademark, and attribution notices and associated disclaimers that may appear in the Source Code or Executable Files.
+ 2. You agree not to advertise or in any way imply that this Work is a product of Your own.
+ 3. The name of the Author may not be used to endorse or promote products derived from the Work without the prior written consent of the Author.
+ 4. You agree not to sell, lease, or rent any part of the Work. This does not restrict you from including the Work or any part of the Work inside a larger software distribution that itself is being sold. The Work by itself, though, cannot be sold, leased or rented.
+ 5. You may distribute the Executable Files and Source Code only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy of the Executable Files or Source Code You distribute and ensure that anyone receiving such Executable Files and Source Code agrees that the terms of this License apply to such Executable Files and/or Source Code. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute the Executable Files or Source Code with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License.
+ 6. You agree not to use the Work for illegal, immoral or improper purposes, or on pages containing illegal, immoral or improper material. The Work is subject to applicable export laws. You agree to comply with all such laws and regulations that may apply to the Work after Your receipt of the Work.
+6. **Representations, Warranties and Disclaimer.** THIS WORK IS PROVIDED "AS IS", "WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE, INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC. AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES OR CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK (OR ANY PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE WORKS.
+7. **Indemnity.** You agree to defend, indemnify and hold harmless the Author and the Publisher from and against any claims, suits, losses, damages, liabilities, costs, and expenses (including reasonable legal or attorneys’ fees) resulting from or relating to any use of the Work by You.
+8. **Limitation on Liability.** EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE, EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+9. **Termination.**
+ 1. This License and the rights granted hereunder will terminate automatically upon any breach by You of any term of this License. Individuals or entities who have received Derivative Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any termination of this License.
+ 2. If You bring a copyright, trademark, patent or any other infringement claim against any contributor over infringements You claim are made by the Work, your License from such contributor to the Work ends automatically.
+ 3. Subject to the above terms and conditions, this License is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, the Author reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+10. **Publisher.** The parties hereby confirm that the Publisher shall not, under any circumstances, be responsible for and shall not have any liability in respect of the subject matter of this License. The Publisher makes no warranty whatsoever in connection with the Work and shall not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. The Publisher reserves the right to cease making the Work available to You at any time without notice
+11. **Miscellaneous**
+ 1. This License shall be governed by the laws of the location of the head office of the Author or if the Author is an individual, the laws of location of the principal place of residence of the Author.
+ 2. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this License, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+ 3. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+ 4. This License constitutes the entire agreement between the parties with respect to the Work licensed herein. There are no understandings, agreements or representations with respect to the Work not specified herein. The Author shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Author and You.
diff --git a/DgvFilterPopup/Properties/Resources.Designer.cs b/DgvFilterPopup/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..3af29e9
--- /dev/null
+++ b/DgvFilterPopup/Properties/Resources.Designer.cs
@@ -0,0 +1,103 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DgvFilterPopup.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DgvFilterPopup.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap Filter_16x {
+ get {
+ object obj = ResourceManager.GetObject("Filter_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap StatusOK_16x {
+ get {
+ object obj = ResourceManager.GetObject("StatusOK_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap StopFilter_16x {
+ get {
+ object obj = ResourceManager.GetObject("StopFilter_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap StopFilters_16x {
+ get {
+ object obj = ResourceManager.GetObject("StopFilters_16x", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/DgvFilterPopup/Properties/Resources.resx b/DgvFilterPopup/Properties/Resources.resx
new file mode 100644
index 0000000..95faf8e
--- /dev/null
+++ b/DgvFilterPopup/Properties/Resources.resx
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\Filter_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\StatusOK_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\StopFilters_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\StopFilter_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
\ No newline at end of file
diff --git a/DgvFilterPopup/Resources/Filter_16x.png b/DgvFilterPopup/Resources/Filter_16x.png
new file mode 100644
index 0000000..43278f0
Binary files /dev/null and b/DgvFilterPopup/Resources/Filter_16x.png differ
diff --git a/DgvFilterPopup/Resources/StatusOK_16x.png b/DgvFilterPopup/Resources/StatusOK_16x.png
new file mode 100644
index 0000000..64332f6
Binary files /dev/null and b/DgvFilterPopup/Resources/StatusOK_16x.png differ
diff --git a/DgvFilterPopup/Resources/StopFilter_16x.png b/DgvFilterPopup/Resources/StopFilter_16x.png
new file mode 100644
index 0000000..97e26d2
Binary files /dev/null and b/DgvFilterPopup/Resources/StopFilter_16x.png differ
diff --git a/DgvFilterPopup/Resources/StopFilters_16x.png b/DgvFilterPopup/Resources/StopFilters_16x.png
new file mode 100644
index 0000000..1a4d4eb
Binary files /dev/null and b/DgvFilterPopup/Resources/StopFilters_16x.png differ
diff --git a/DragNDrop/DragNDrop.csproj b/DragNDrop/DragNDrop.csproj
index 6625a4a..0dff508 100644
--- a/DragNDrop/DragNDrop.csproj
+++ b/DragNDrop/DragNDrop.csproj
@@ -1,133 +1,14 @@
-
-
+
+
- Local
- 7.10.3077
- 2.0
- {C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}
- Debug
- AnyCPU
-
-
- DragNDrop
-
- JScript
- Grid
- IE50
- falseLibrary
+ net8.0-windows
+ trueDragNDrop
- OnBuildSuccess
-
-
-
-
-
- 0.0
- v4.8
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- bin\Debug\
- false
- 285212672
- false
-
- DEBUG;TRACE
-
- true
- 4096
- false
-
- false
- false
- false
- false
- 4
- full
- prompt
- MinimumRecommendedRules.ruleset
- false
- x64
-
-
- bin\Release\
- false
- 285212672
- false
-
- TRACE
-
- false
- 4096
- false
-
- true
- false
- false
- false
- 4
- none
- prompt
- MinimumRecommendedRules.ruleset
- false
-
-
-
- System
-
-
- System.Data
-
-
- System.Drawing
-
-
- System.Drawing.Design
-
-
- System.Windows.Forms
-
-
- System.XML
-
-
-
-
- Code
-
-
- Component
-
-
- DragAndDropListView.cs
-
-
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
-
-
-
-
+ DragNDrop
+ false
+ disable
+ disable
-
\ No newline at end of file
+
+
diff --git a/MMDLoader/MMDLoader.csproj b/MMDLoader/MMDLoader.csproj
index e60d0a3..a300332 100644
--- a/MMDLoader/MMDLoader.csproj
+++ b/MMDLoader/MMDLoader.csproj
@@ -2,7 +2,7 @@
WinExe
- net6.0-windows
+ net8.0-windowsenabletrueTrue
diff --git a/MODERNIZATION.md b/MODERNIZATION.md
new file mode 100644
index 0000000..de2172f
--- /dev/null
+++ b/MODERNIZATION.md
@@ -0,0 +1,154 @@
+# varManager 现代化说明(.NET 8 + SQLite)
+
+本次改造的目标:**解决在 Windows 11 上因 Microsoft Access(ACE/Jet OLEDB)驱动导致的频繁报错,并把工程现代化到 .NET 8;不丢失任何现有功能,仅优化兼容性与编译方式。**
+
+## 为什么会在 Win11 报错(根因)
+
+旧版主程序用强类型 DataSet,通过 **`Microsoft.ACE.OLEDB.12.0`** 驱动读写 Access 的 `varManager.mdb`。
+该驱动需要单独安装“Access Database Engine 可再发行组件”,且**位数必须与程序一致**(x64 程序需 x64 ACE,常与系统里 32 位 Office 冲突),于是出现
+“provider not registered / 频繁报错”。`.NET Framework 4.8` 本身在 Win11 上没问题——**问题在数据库驱动**。
+
+## 主要变更
+
+| 项 | 旧 | 新 |
+|---|---|---|
+| 数据库 | Access `varManager.mdb`(ACE OLEDB,需装驱动) | **内嵌 SQLite**(`varManager.sqlite`,免安装、无位数问题) |
+| 数据访问 | VS 生成的 OleDb TableAdapter | 同名 TableAdapter,改用 `System.Data.SQLite`(`SQLiteDataAdapter`+`SQLiteCommandBuilder`) |
+| 主程序框架 | .NET Framework 4.8(旧式 csproj) | **.NET 8**(`net8.0-windows`,SDK 式工程,WinForms) |
+| DragNDrop 控件库 | .NET Framework 4.8 | **.NET 8** |
+| DgvFilterPopup 依赖 | 引用仓库外缺失项目(无法编译) | **vendored 进仓库**(CPOL 源码,重编为 .NET 8) |
+| MMDLoader | .NET 6 | **.NET 8** |
+| LoadScene | .NET 3.5(VaM/Unity 插件) | **保持 .NET 3.5 不变**(见下方注意事项) |
+
+> 上层所有窗体代码**未改动**:仍调用一模一样的 `Fill / GetData / Update / FillByDepens / FillBy / FillByLoadable / DeleteAll` 等方法,只是底层从 Access 换成了 SQLite。
+
+## 数据库与数据迁移
+
+- 首次运行时,`Db.Initialize()` 会创建 `varManager.sqlite` 并建好全部表/索引/视图
+ (schema 见 [`migration/schema.sql`](migration/schema.sql),作为嵌入资源打包)。
+- **数据库位置(重要)**:程序自动选择一个可写目录——
+ - exe 所在目录若是**本地可写盘**,就放在 exe 旁(便携);
+ - 否则(只读目录、或 exe 在**网络盘/映射盘**上)放到 **`%LOCALAPPDATA%\varManager\`**(即 `C:\Users\<你>\AppData\Local\varManager`)。
+ - 之所以这样:本程序清单要求**管理员权限**,而 Windows 提权会话**看不到普通会话里映射的网络盘**;同时 SQLite 在 SMB 网络盘上锁机制不可靠。把库放本地磁盘可彻底规避“unable to open database file”。
+ - 启动报错对话框会显示实际使用的“数据目录”,便于定位。
+- 两个 Access 存储查询 `installedScenes`、`varsView` 已原样复刻为 SQLite **视图**;
+ `scenesView` / `HideFav` 本就是程序内存中的 DataTable,与数据库无关。
+- **保留旧数据(可选)**:把旧的 `varManager.mdb` 放到上面的**数据目录**(本地安装=exe 旁;网络盘/提权场景=`%LOCALAPPDATA%\varManager\`),首次运行会自动把
+ `vars / installStatus / scenes / dependencies / savedepens` 五张表导入 SQLite(`MdbToSqliteMigrator`)。
+ - 读取旧 `.mdb` 仍需本机有 ACE 驱动;若没有/读取失败,**不会崩溃**:保留空库,程序通过重新扫描 var 仓库自动重建索引。
+ - **隐藏/收藏(hide/fav)状态不在数据库里**——它存为 VaM `AddonPackagesFilePrefs\...\*.hide / *.fav` 标记文件,任何数据库迁移都不影响,天然保留。
+
+## 旧数据迁移工具(界面内 + 命令行)
+
+把旧版 Access(`varManager.mdb`)里的全部数据一次性导入新 SQLite,**可分别选择源/目标路径**,适配“旧程序在 D 盘、新程序在别处”的情况:
+
+- **界面内**:启动 varManager → 打开 **Settings** → 左下角 **「从旧版(Access)迁移数据…」** → 对话框中:
+ - 源:选旧程序的 `varManager.mdb`(或其所在文件夹);
+ - 目标:默认就是当前程序使用的 SQLite 库(也可另选);
+ - 勾选「迁移前清空目标表(全量覆盖)」做全量迁移 → 开始。带实时进度与逐表结果。
+- **命令行**:`varManager.exe --migrate` 直接打开迁移对话框。
+
+读取 `.mdb` 需本机有 ACE OLEDB 驱动(失败会有明确提示)。迁移**保留原始 ID**;隐藏/收藏标记本就是文件、不受影响。迁完若目标=当前库,需重启 varManager 加载新数据。
+
+> 已用真实数据验证:导入 **357,949 行**(vars 13442 / installStatus 13430 / scenes 193876 / dependencies 129823 / savedepens 7378)**仅 2.6 秒**,目标库行数与视图(varsView/installedScenes)校验全部一致。
+
+## 性能优化(SQLite 写路径 + 启动)
+
+切到 SQLite 后第一版出现“启动慢、扫描时 C 盘狂读写”,根因与修复:
+
+| 问题 | 根因 | 修复 |
+|---|---|---|
+| 扫描/批量编辑时系统盘 IO 极高 | 每个 `DataAdapter.Update` 的每一行都是独立 autocommit 事务 → 逐行 journal + fsync | `UpdateCore` 把整批 `Update` 包进**单个事务**;连接串加 `Journal Mode=WAL;Synchronous=Normal`(可重建的索引库,安全) |
+| 每次保存都很慢 | `SQLiteCommandBuilder` 每次 Update 都重新查一遍表结构生成 CRUD | 生成的 Insert/Update/Delete 命令**缓存复用**(连接变更时失效重建) |
+| Hide\|Fav(场景管理)开关后内存暴涨、卡顿 | 每个窗体一套适配器、每适配器一条连接;`Cache Size=16000` 页(≈64MB/连接)叠加连接池让关闭后的连接带着页缓存常驻进程 | **不用连接池**,`Cache Size=-8192`(8MB 上限,连接关闭即释放);适配器 `Dispose` 时确定性释放连接与缓存命令 |
+| 浏览预览图后内存可达 10GB+、退出卡死 | **原版遗留缺陷,被 .NET 8 GC 行为放大**:`Image.FromFile` 的源位图(原生内存,GC 几乎感知不到)加入 ImageList 后从不 Dispose;且滚动缓存上限(40/20 张)小于一屏可见项数 → 可见项互相踢出缓存,**每次重绘都重载并泄漏整屏位图**;大预览图 `PictureBox.Image` 换图也不释放旧图 | `Comm.AddImageToList`(ImageList 内部拷贝后**立即 Dispose 源图**)、`TrimImageList`(上限 256/滞回 192,大于可见项数,杜绝互踢)、`SwapPictureBoxImage`(换图即释放旧图),覆盖 Form1 / FormScenes / FormUninstallVars 全部 8 处;FormScenes 关闭时释放预览图 |
+| **关闭场景管理/退出程序时卡死数十秒**(.NET 8 独有) | .NET 8 WinForms 在**窗口销毁时**(`WmDestroy → ReleaseUiaProvider`)会把虚拟 ListView 的条目**逐项枚举一遍**——几万项 × 每项触发一次 `RetrieveVirtualItem`(读图/建项),.NET Framework 无此行为;且 `components.Dispose()` 先于子窗口销毁,销毁期重入会撞上已释放的 ImageList → `Parameter is not valid` 崩溃 | `FormClosing` 时置 `closingDown` 标志并把所有虚拟列表 `VirtualListSize = 0`(销毁期枚举变为 0 项),`RetrieveVirtualItem` 入口加关闭防卫返回空项;`AddImageToList` 先强制创建 ImageList 句柄再添加(句柄存在时 Add 立即拷贝,源图可安全释放)。实测关闭从卡死降至 **~100ms** |
+| 启动卡界面 | 启动期 DB 加载 + 安装状态核对都在 UI 线程 | 全部移到后台 `BackgroundWorker`,完成后再渲染表格(`installStatus` 用单事务 `BulkReplace`,避免“全部显示未安装”的闪烁) |
+
+**真实规模基准**(用户真实库:13.4k vars / 194k scenes / 130k deps,在 NVMe 上):
+
+```
+启动加载: vars.Fill 66ms · scenes.Fill 651ms · deps.Fill 336ms · varsView 98ms (合计 ~1.3s)
+批量写 : 改写全部 vars 232ms · 新增 1 万 scenes 176ms · 删除 1 万 171ms
+ installStatus 全量 BulkReplace 1.3 万行 28ms · 500 次单行 Update 48ms
+```
+
+## UI 一致性(与原版逐像素对齐)
+
+各窗体原本用 `AutoScaleMode.Font` + `AutoScaleDimensions=(8,17)`(按 .NET Framework 对 Cambria 9pt 的度量基准设计)。.NET 8 对同一字体的度量不同(≈7×14),Font 模式据此把**所有控件按 ~0.85 缩小**、但字号不变 → 固定尺寸按钮(如底部 70×42 双行按钮)塞不下文字而被裁切。
+
+修复:全部窗体改 **`AutoScaleMode.None`**(原版运行期缩放因子恒为 1,None 即等价于“不缩放”),布局回到设计稿、与原版逐像素一致。已用 UI Automation 实测按钮尺寸 + 截图比对验证。
+
+> 同时 `Program.Main` 用 `ApplicationConfiguration.Initialize()` 并在 csproj 声明 `ApplicationHighDpiMode=DpiUnaware`,与原版无 DPI 感知的行为对齐(双保险)。
+
+## 如何构建
+
+需要 .NET 8 SDK(无需 Visual Studio):
+
+```powershell
+# 编译整个解决方案(varManager + DragNDrop + DgvFilterPopup + MMDLoader)
+dotnet build varManager.sln -c Release
+```
+
+发布可分发版本:
+
+```powershell
+# 方式 A:框架依赖(体积小,目标机需装 “.NET 8 Desktop Runtime”)
+dotnet publish varManager\varManager.csproj -c Release -r win-x64 --no-self-contained -o dist\varManager-win-x64
+
+# 方式 B:自包含(免装运行时,体积约 ~150MB,拷贝即用)
+dotnet publish varManager\varManager.csproj -c Release -r win-x64 --self-contained -o dist\varManager-selfcontained
+# 如需单文件,追加: -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
+```
+
+## 注意事项
+
+- **LoadScene 必须保持 .NET 3.5**:它是注入 Virt-a-Mate(老版 Unity/Mono)内部运行的插件,
+ 引用 VaM 的 `Assembly-CSharp.dll`/`UnityEngine*.dll`。升级框架会使其无法在 VaM 内加载,
+ 因此本次**不改动**,也未纳入 `varManager.sln`;它与 Win11 兼容性问题无关,按原工具链单独构建即可。
+- 程序清单要求**管理员权限**(创建符号链接所需),首次启动会有 UAC 提示——这是原有行为。
+- 旧 `varManager.mdb` / 仓库根的空 `varManager.db` 已不再参与编译或打包,仅保留作参考。
+- 数千条 `CA1416` 编译警告是“WinForms API 仅 Windows 可用”的提示,对 `net8.0-windows` 无害。
+
+## .NET 8 行为差异:全项目系统审计(2026-06)
+
+把所有"在 .NET Framework 能用、到 .NET 8 默认行为变了"的高发模式过了一遍。**已修复**的:
+
+| 模式 | .NET 8 的变化 | 处理 |
+|---|---|---|
+| `Process.Start("https://…" / 文件夹)` | 默认 `UseShellExecute` 由 true→false,把 URL 当可执行路径 → "系统找不到指定的文件" | 统一 `Comm.OpenShell()`(显式 `UseShellExecute=true`+try/catch),替换 8 处:Hub 作品页/下载、Google 搜索缺失 var、打开 Stale/旧版本文件夹、日志 |
+| `Directory.GetCurrentDirectory()` 定位 `Cache\` | 返回的是进程**工作目录**(文件对话框/提权会改它),非 exe 目录 → 缓存写一处、读/清另一处,缓存形同失效 | 统一 `Comm.CacheDir`(基于稳定的 `AppContext.BaseDirectory`),替换 5 处 |
+| 默认 DPI 感知 / 字体度量 / `AutoScaleMode.Font` | 见上文 UI 章节 | 全窗体 `AutoScaleMode.None` + DpiUnaware |
+| 窗体销毁期 UIA 枚举虚拟列表 / GDI 位图不释放 | 见上文内存章节 | 关闭时 `VirtualListSize=0`、`Comm` 图片助手确定性释放 |
+
+**已审计、确认安全(无需改)**:`Clipboard.SetText`、`Settings.Default.Save()`、命名 `Mutex`/`WaitOne`/`ReleaseMutex`、`BackgroundWorker`+`e.Error`、SharpZipLib `ZipFile`、现代 `HttpClient`、P/Invoke `CreateSymbolicLink`、SimpleJSON 自有 Serialize、ISO 格式 `DateTime.Parse`、数字/日期 `ToString("…")`。
+**无任何**危险 API:没有 `BinaryFormatter`/`SoapFormatter`、`WebClient`、`Registry`、`SmtpClient`、`Thread.Abort`、`AppDomain` 卸载。
+**有意保留 .NET 8 行为**:读 var 包内 `meta.json` 用 `StreamReader` 默认 UTF-8——VAM 规范就是 UTF-8,这比旧框架按系统 ANSI(GBK)读更正确,不回改。
+
+## 使用体验优化(2026-06)
+
+针对实际使用中的三处不顺手:
+
+| 体验问题 | 根因 | 优化 |
+|---|---|---|
+| 主表滚动一卡一卡 | `DataGridView` 默认不双缓冲,.NET 8 重绘下卡顿更明显 | 反射开启 `DoubleBuffered`(`EnableDoubleBuffer`),滚动平滑 |
+| 一次只能 install/uninstall **500** 条、delete **50** 条 | Access 时代怕单次写太多的保护 | install/uninstall **取消硬上限**(SQLite 事务化后批量持久化很快)+ 操作时等待光标;delete 真删文件,放宽到 **5000**(防"全选误删"的保险) |
+| 重建符号链接 / 修复预览图等点完不知跑没跑完,期间点别的就崩(`This BackgroundWorker is currently busy`) | ~11 个功能共用同一个 `backgroundWorkerInstall`,各按钮直接 `RunWorkerAsync` 不查 `IsBusy` | 统一入口 `RunBackgroundTask`:忙时**友好提示不崩**;运行中**标题栏显示"正在执行: xxx…"**+ 等待光标;完成自动恢复 |
+
+## 本次改造已验证
+
+- ✅ 解决方案 Release 全量编译:**0 错误**。
+- ✅ 数据层冒烟测试([`tests/DbSmokeTest`](tests/DbSmokeTest)):用真实 `System.Data.SQLite`
+ 跑通建库、增删改查、两个视图、位置参数自定义查询、自增 ID、日期/布尔往返——全部通过。
+- ✅ `.mdb→SQLite` 迁移测试:从 Access 读出并正确导入 SQLite,字段值与 ID 保留。
+- ⚠️ 完整 GUI 行为需你在自己的 VaM 环境中实测(涉及真实 var 目录、符号链接、管理员权限)。
+
+## 关键新增/改动文件
+
+- `varManager/varManagerDataSet.SqliteAdapters.cs` —— 新的 SQLite TableAdapter(替换原 OleDb 适配器)
+- `varManager/Db.cs` —— SQLite 引导(建库 + 触发迁移)
+- `varManager/MdbToSqliteMigrator.cs` —— 旧 .mdb → SQLite 一次性导入
+- `varManager/varManagerDataSet.Designer.cs` —— 截断保留 DataSet/DataTable/DataRow 类型(移除 OleDb 适配器段)
+- `migration/schema.sql` —— SQLite 库结构(单一事实来源,嵌入主程序)
+- `DgvFilterPopup/` —— vendored 的列筛选控件(CPOL),重编为 net8
+- `migration/legacy/` —— 原始 `varManagerDataSet.Designer.cs` 与旧 `.sln` 的备份
diff --git a/README.md b/README.md
index 6328da2..d10fe76 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,13 @@ varManager
var Manager for virt-a-mate
This tool is used to manage var files.
The main method is to place all var files to the repository directory.Create a symlink link to the var file in the AddonPackages directory as needed.
+
+---
+
+## .NET 8 + SQLite 现代化版本
+
+为解决在 Windows 11 上 Microsoft Access(ACE/Jet OLEDB)驱动导致的频繁报错,本分支已将主程序迁移到 **.NET 8 + 内嵌 SQLite**(免安装数据库驱动、无位数冲突),功能保持不变。
+
+构建:`dotnet build varManager.sln -c Release`(需 .NET 8 SDK,无需 Visual Studio)。
+
+详见 [MODERNIZATION.md](MODERNIZATION.md)。
diff --git a/migration/schema.sql b/migration/schema.sql
new file mode 100644
index 0000000..b7617f1
--- /dev/null
+++ b/migration/schema.sql
@@ -0,0 +1,94 @@
+-- ============================================================================
+-- varManager SQLite schema (faithful port of the original Access/Jet varManager.mdb)
+--
+-- Generated for the .NET 8 + SQLite modernization of varManager.
+-- Column types/keys/indexes mirror the original Access database (extracted via ADOX).
+-- The two Access saved queries (installedScenes, varsView) are recreated as SQLite VIEWs.
+-- scenesView / HideFav are NOT here: they are in-memory DataTables in the app, never DB-backed.
+--
+-- Booleans are stored as 0/1 (SQLite has no bool; declared type BOOLEAN lets the
+-- ADO.NET provider surface them as System.Boolean for the typed DataSet).
+-- Date/time columns use declared type DATETIME (provider stores ISO-8601 text).
+-- ============================================================================
+
+PRAGMA foreign_keys = OFF;
+
+-- ---- vars -------------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS vars (
+ varName TEXT NOT NULL PRIMARY KEY,
+ varPath TEXT,
+ creatorName TEXT,
+ packageName TEXT,
+ version INTEGER,
+ metaDate DATETIME,
+ varDate DATETIME,
+ filesize REAL,
+ scenes INTEGER,
+ looks INTEGER,
+ clothing INTEGER,
+ hairstyle INTEGER,
+ plugins INTEGER,
+ assets INTEGER,
+ morphs INTEGER,
+ pose INTEGER,
+ skin INTEGER
+);
+CREATE INDEX IF NOT EXISTS idx_vars_creatorName ON vars(creatorName);
+CREATE INDEX IF NOT EXISTS idx_vars_packageName ON vars(packageName);
+CREATE INDEX IF NOT EXISTS idx_vars_varDate ON vars(varDate);
+CREATE INDEX IF NOT EXISTS idx_vars_scenes ON vars(scenes);
+CREATE INDEX IF NOT EXISTS idx_vars_looks ON vars(looks);
+CREATE INDEX IF NOT EXISTS idx_vars_clothing ON vars(clothing);
+CREATE INDEX IF NOT EXISTS idx_vars_hairstyle ON vars(hairstyle);
+CREATE INDEX IF NOT EXISTS idx_vars_plugins ON vars(plugins);
+CREATE INDEX IF NOT EXISTS idx_vars_assets ON vars(assets);
+
+-- ---- scenes -----------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS scenes (
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ varName TEXT,
+ atomType TEXT,
+ isPreset BOOLEAN,
+ scenePath TEXT,
+ previewPic TEXT
+);
+CREATE INDEX IF NOT EXISTS idx_scenes_atomType ON scenes(atomType);
+CREATE INDEX IF NOT EXISTS idx_scenes_varName ON scenes(varName);
+
+-- ---- installStatus ----------------------------------------------------------
+CREATE TABLE IF NOT EXISTS installStatus (
+ varName TEXT NOT NULL PRIMARY KEY,
+ Installed BOOLEAN,
+ Disabled BOOLEAN
+);
+
+-- ---- dependencies -----------------------------------------------------------
+CREATE TABLE IF NOT EXISTS dependencies (
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ varName TEXT NOT NULL,
+ dependency TEXT NOT NULL
+);
+CREATE INDEX IF NOT EXISTS idx_dependencies_dependency ON dependencies(dependency);
+CREATE INDEX IF NOT EXISTS idx_dependencies_varName ON dependencies(varName);
+
+-- ---- savedepens -------------------------------------------------------------
+CREATE TABLE IF NOT EXISTS savedepens (
+ ID INTEGER PRIMARY KEY AUTOINCREMENT,
+ savepath TEXT NOT NULL,
+ modidate DATETIME,
+ dependency TEXT NOT NULL
+);
+CREATE INDEX IF NOT EXISTS idx_savedepens_dependency ON savedepens(dependency);
+CREATE INDEX IF NOT EXISTS idx_savedepens_savepath ON savedepens(savepath);
+
+-- ---- VIEW: installedScenes (Access INNER JOINs; Installed=True -> =1) -------
+CREATE VIEW IF NOT EXISTS installedScenes AS
+SELECT scenes.*, vars.metaDate, vars.varDate, installStatus.Installed
+FROM (installStatus INNER JOIN scenes ON installStatus.varName = scenes.varName)
+ INNER JOIN vars ON scenes.varName = vars.varName
+WHERE installStatus.Installed = 1;
+
+-- ---- VIEW: varsView (Access LEFT JOIN; [filesize]/1024/1024 AS fsize) -------
+CREATE VIEW IF NOT EXISTS varsView AS
+SELECT vars.*, installStatus.Installed, installStatus.Disabled, filesize / 1024 / 1024 AS fsize
+FROM vars LEFT JOIN installStatus ON vars.varName = installStatus.varName;
diff --git a/migration/validate_schema.py b/migration/validate_schema.py
new file mode 100644
index 0000000..eceba7b
--- /dev/null
+++ b/migration/validate_schema.py
@@ -0,0 +1,52 @@
+"""Validate that the SQLite schema accepts every SQL statement the app actually runs.
+Creates a temp DB from schema.sql, seeds sample rows, then executes each real query."""
+import sqlite3, os, sys, datetime
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+schema = open(os.path.join(HERE, "schema.sql"), encoding="utf-8").read()
+
+con = sqlite3.connect(":memory:")
+con.executescript(schema)
+ok, fail = 0, 0
+def run(label, sql, params=()):
+ global ok, fail
+ try:
+ cur = con.execute(sql, params)
+ rows = cur.fetchall() if sql.strip().lower().startswith("select") else None
+ n = (" -> %d rows" % len(rows)) if rows is not None else ""
+ print(f" OK {label}{n}")
+ ok += 1
+ except Exception as e:
+ print(f" FAIL {label}: {e}\n SQL: {sql}")
+ fail += 1
+
+now = datetime.datetime(2024, 1, 2, 3, 4, 5)
+# --- seed one fully-linked var so the views return rows ---
+run("seed vars", "INSERT INTO vars (varName,varPath,creatorName,packageName,version,metaDate,varDate,filesize,scenes,looks,clothing,hairstyle,plugins,assets,morphs,pose,skin) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ ("Creator.Pack.1","D:/vars/Creator.Pack.1.var","Creator","Pack",1,now,now,12_582_912.0,2,1,0,0,0,0,3,0,1))
+run("seed installStatus", "INSERT INTO installStatus (varName,Installed,Disabled) VALUES (?,?,?)", ("Creator.Pack.1", 1, 0))
+run("seed scenes", "INSERT INTO scenes (varName,atomType,isPreset,scenePath,previewPic) VALUES (?,?,?,?,?)",
+ ("Creator.Pack.1","scenes",0,"Saves/scene/x.json","Saves/scene/x.jpg"))
+run("seed dependencies", "INSERT INTO dependencies (varName,dependency) VALUES (?,?)", ("Creator.Pack.1","Other.Thing.2"))
+run("seed savedepens", "INSERT INTO savedepens (savepath,modidate,dependency) VALUES (?,?,?)", ("Saves/x.json", now, "Other.Thing.2"))
+
+print("-- app SELECT commands --")
+run("vars.Fill", "SELECT varName, varPath, creatorName, packageName, version, metaDate, varDate, filesize, scenes, looks, clothing, hairstyle, plugins, assets, morphs, pose, skin FROM vars")
+run("scenes.Fill", "SELECT ID, varName, atomType, isPreset, scenePath, previewPic FROM scenes")
+run("scenes.FillBy(varName)", "SELECT ID, varName, atomType, isPreset, scenePath, previewPic FROM scenes WHERE (varName = ?)", ("Creator.Pack.1",))
+run("scenes.FillByLoadable", "SELECT ID, varName, atomType, isPreset, scenePath, previewPic FROM scenes WHERE (atomType = 'scenes') OR (isPreset = true)")
+run("installStatus.Fill", "SELECT varName, Installed, Disabled FROM installStatus")
+run("dependencies.Fill", "SELECT ID, varName, dependency FROM dependencies")
+run("savedepens.Fill", "SELECT ID, savepath, modidate, dependency FROM savedepens")
+run("savedepens.FillByDepens", "SELECT ID, savepath, modidate, dependency FROM savedepens whe WHERE (dependency = ?)", ("Other.Thing.2",))
+run("installedScenes.Fill (VIEW)", "SELECT ID, atomType, varName, scenePath, previewPic, metaDate, varDate, Installed FROM installedScenes")
+run("varsView.Fill (VIEW)", "SELECT varName, varPath, creatorName, packageName, version, metaDate, varDate, filesize, scenes, looks, clothing, hairstyle, plugins, assets, morphs, pose, skin, Installed, Disabled, fsize FROM varsView")
+
+print("-- app CRUD commands (optimistic-concurrency WHERE, positional ?) --")
+run("dependencies.Insert", "INSERT INTO `dependencies` (`varName`, `dependency`) VALUES (?, ?)", ("a","b"))
+run("dependencies.Update", "UPDATE `dependencies` SET `varName` = ?, `dependency` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `varName` IS NULL) OR (`varName` = ?)) AND ((? = 1 AND `dependency` IS NULL) OR (`dependency` = ?)))", ("a2","b2",1,0,"Creator.Pack.1",0,"Other.Thing.2"))
+run("scenes.Update", "UPDATE `scenes` SET `varName` = ?, `atomType` = ?, `isPreset` = ?, `scenePath` = ?, `previewPic` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `varName` IS NULL) OR (`varName` = ?)) AND ((? = 1 AND `atomType` IS NULL) OR (`atomType` = ?)) AND ((? = 1 AND `isPreset` IS NULL) OR (`isPreset` = ?)) AND ((? = 1 AND `scenePath` IS NULL) OR (`scenePath` = ?)) AND ((? = 1 AND `previewPic` IS NULL) OR (`previewPic` = ?)))", ("Creator.Pack.1","scenes",0,"p","q",1,0,"Creator.Pack.1",0,"scenes",0,0,0,"Saves/scene/x.json",0,"Saves/scene/x.jpg"))
+run("installStatus.DeleteAll (was 'DELETE *')", "DELETE FROM `installStatus`")
+
+print(f"\nRESULT: {ok} OK, {fail} FAIL")
+sys.exit(1 if fail else 0)
diff --git a/varManager.sln b/varManager.sln
index 263ec73..0d195e5 100644
--- a/varManager.sln
+++ b/varManager.sln
@@ -1,49 +1,40 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.1.32407.343
+VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "varManager", "varManager\varManager.csproj", "{EA2A1B27-CA81-4DBF-8E10-97A0243B6184}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "varManager", "varManager\varManager.csproj", "{86724F54-6B95-4B31-82B3-345F4368B33A}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DgvFilterPopup", "..\DgvFilterPopup\DgvFilterPopup\DgvFilterPopup.csproj", "{4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DragNDrop", "DragNDrop\DragNDrop.csproj", "{53E882B4-808B-4C0A-874D-9C24043272FF}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DragNDrop", "DragNDrop\DragNDrop.csproj", "{C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DgvFilterPopup", "DgvFilterPopup\DgvFilterPopup.csproj", "{7D4FC535-B1E4-4D31-8F72-DA6AB3569BA4}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MMDLoader", "MMDLoader\MMDLoader.csproj", "{60569535-F3F9-4412-82D8-9EB84DA0CFD6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadScene", "LoadScene\LoadScene.csproj", "{8D90CE12-F58A-4AD9-81E6-A93B3D6BB2EE}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MMDLoader", "MMDLoader\MMDLoader.csproj", "{15BB925F-EAC7-441B-9E65-D7392A96D47A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {EA2A1B27-CA81-4DBF-8E10-97A0243B6184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EA2A1B27-CA81-4DBF-8E10-97A0243B6184}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EA2A1B27-CA81-4DBF-8E10-97A0243B6184}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EA2A1B27-CA81-4DBF-8E10-97A0243B6184}.Release|Any CPU.Build.0 = Release|Any CPU
- {4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}.Release|Any CPU.Build.0 = Release|Any CPU
- {C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C7E21F05-C166-4DCC-8429-EC8A4C1A67B6}.Release|Any CPU.Build.0 = Release|Any CPU
- {60569535-F3F9-4412-82D8-9EB84DA0CFD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {60569535-F3F9-4412-82D8-9EB84DA0CFD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {60569535-F3F9-4412-82D8-9EB84DA0CFD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {60569535-F3F9-4412-82D8-9EB84DA0CFD6}.Release|Any CPU.Build.0 = Release|Any CPU
- {8D90CE12-F58A-4AD9-81E6-A93B3D6BB2EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8D90CE12-F58A-4AD9-81E6-A93B3D6BB2EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8D90CE12-F58A-4AD9-81E6-A93B3D6BB2EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8D90CE12-F58A-4AD9-81E6-A93B3D6BB2EE}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {D0040F30-0947-4707-95E7-97AFD37A5633}
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {86724F54-6B95-4B31-82B3-345F4368B33A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {86724F54-6B95-4B31-82B3-345F4368B33A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {86724F54-6B95-4B31-82B3-345F4368B33A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {86724F54-6B95-4B31-82B3-345F4368B33A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {53E882B4-808B-4C0A-874D-9C24043272FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {53E882B4-808B-4C0A-874D-9C24043272FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {53E882B4-808B-4C0A-874D-9C24043272FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {53E882B4-808B-4C0A-874D-9C24043272FF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7D4FC535-B1E4-4D31-8F72-DA6AB3569BA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D4FC535-B1E4-4D31-8F72-DA6AB3569BA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D4FC535-B1E4-4D31-8F72-DA6AB3569BA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D4FC535-B1E4-4D31-8F72-DA6AB3569BA4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {15BB925F-EAC7-441B-9E65-D7392A96D47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {15BB925F-EAC7-441B-9E65-D7392A96D47A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {15BB925F-EAC7-441B-9E65-D7392A96D47A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {15BB925F-EAC7-441B-9E65-D7392A96D47A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/varManager/App.config b/varManager/App.config
index cd4db28..da2d1f5 100644
--- a/varManager/App.config
+++ b/varManager/App.config
@@ -1,72 +1,36 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- d:\vars
-
-
- d:\virt_a_mate
-
-
- True
-
-
- True
-
-
- False
-
-
- True
-
-
- True
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ d:\vars
+
+
+ d:\virt_a_mate
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+ True
+
+
+ True
+
+
+ False
+
+
+
diff --git a/varManager/Comm.cs b/varManager/Comm.cs
index f49586c..b095dc3 100644
--- a/varManager/Comm.cs
+++ b/varManager/Comm.cs
@@ -9,6 +9,80 @@ namespace varManager
{
static class Comm
{
+ // ---- image hygiene -------------------------------------------------
+ // GDI+ bitmaps are native memory the GC barely sees (tiny managed wrapper,
+ // megabytes of native pixels). The original code loaded Image.FromFile into
+ // ImageLists / PictureBoxes and never disposed the sources, leaving gigabytes
+ // of unfinalized native bitmaps after browsing previews. These helpers make
+ // every load deterministic: ImageList copies the image internally, so the
+ // source is disposed immediately; PictureBox swaps dispose the old image.
+
+ /// Add an image file to an ImageList and dispose the source right away.
+ /// The native handle is forced FIRST: with a created handle the ImageList copies
+ /// the bitmap immediately, so disposing the source is safe. Without it the
+ /// ImageList only stores a reference and converts at CreateHandle — by then a
+ /// disposed source throws "Parameter is not valid". Key may be null (unkeyed).
+ public static void AddImageToList(System.Windows.Forms.ImageList list, string key, string path)
+ {
+ var _ = list.Handle; // force native image list creation before Add
+ using (var img = System.Drawing.Image.FromFile(path))
+ {
+ if (key == null) list.Images.Add(img);
+ else list.Images.Add(key, img);
+ }
+ }
+
+ /// Bound an ImageList used as a scroll cache: when it exceeds
+ /// entries, evict oldest down to
+ /// (hysteresis avoids the visible-items-evicting-each-other thrash of a
+ /// remove-one-per-add policy).
+ public static void TrimImageList(System.Windows.Forms.ImageList list, int max, int trimTo)
+ {
+ if (list.Images.Count <= max) return;
+ while (list.Images.Count > trimTo)
+ list.Images.RemoveAt(0);
+ }
+
+ /// Show an image file in a PictureBox, disposing whatever image the box
+ /// held before. Pass null/empty to just clear and free.
+ public static void SwapPictureBoxImage(System.Windows.Forms.PictureBox box, string path)
+ {
+ var old = box.Image;
+ box.Image = string.IsNullOrEmpty(path) ? null : System.Drawing.Image.FromFile(path);
+ if (old != null) old.Dispose();
+ }
+ // --------------------------------------------------------------------
+
+ ///
+ /// Open a URL, file, or folder with the OS default handler.
+ /// .NET Framework's Process.Start(string) implicitly used ShellExecute, so passing a
+ /// URL like "https://..." just opened the browser. .NET 8/Core flipped the default to
+ /// UseShellExecute=false, which treats the string as an executable path → "系统找不到
+ /// 指定的文件". This restores the original behaviour explicitly.
+ ///
+ public static void OpenShell(string target)
+ {
+ if (string.IsNullOrWhiteSpace(target)) return;
+ try
+ {
+ System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(target) { UseShellExecute = true });
+ }
+ catch (System.Exception ex)
+ {
+ System.Windows.Forms.MessageBox.Show("无法打开:\n" + target + "\n\n" + ex.Message,
+ "varManager", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
+ }
+ }
+
+ ///
+ /// The scene-analysis cache folder next to the executable. The original code used
+ /// Directory.GetCurrentDirectory(), which is the process *working directory* — not the
+ /// exe folder. WinForms file dialogs and "run as admin" can change it, so the cache
+ /// could be written to one place and read/cleared from another (cache silently never
+ /// hit). AppContext.BaseDirectory is the stable exe location.
+ ///
+ public static string CacheDir => Path.Combine(AppContext.BaseDirectory, "Cache");
+
public static void LocateFile(string filePath)
{
if (!File.Exists(filePath))
diff --git a/varManager/Db.cs b/varManager/Db.cs
new file mode 100644
index 0000000..9e6c2a9
--- /dev/null
+++ b/varManager/Db.cs
@@ -0,0 +1,204 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Data.SQLite;
+
+namespace varManager
+{
+ ///
+ /// Central SQLite bootstrap for varManager. Replaces the old Access/ACE-OLEDB database.
+ ///
+ /// The database lives in a *writable* data directory chosen at startup:
+ /// 1. next to the executable, if that folder is writable (portable / local installs);
+ /// 2. otherwise %LOCALAPPDATA%\varManager (used when the exe sits on a read-only path,
+ /// or on a mapped network drive that is invisible to the elevated process — this app
+ /// runs as administrator, and mapped drives are not shared across logon sessions).
+ ///
+ /// On startup :
+ /// - resolves the data directory and connection string,
+ /// - creates the schema if needed (idempotent),
+ /// - on a brand-new database, attempts a one-time import of a legacy varManager.mdb
+ /// (best effort; the DB is otherwise rebuilt by rescanning the var repository).
+ ///
+ public static class Db
+ {
+ public static string DataDirectory { get; private set; }
+ public static string DatabasePath { get; private set; }
+ public static string ConnectionString { get; private set; }
+
+ /// Set if the one-time .mdb import failed; the UI may surface this.
+ public static string LastMigrationError { get; private set; }
+
+ /// Number of rows imported during the one-time migration (0 if none/fresh).
+ public static int MigratedRowCount { get; private set; }
+
+ public static void Initialize()
+ {
+ Initialize(null);
+ }
+
+ /// Initialize with an explicit data directory (tests/sandboxes). The normal
+ /// app path passes null and gets the standard resolution (exe dir / LocalAppData).
+ public static void Initialize(string dataDirectoryOverride)
+ {
+ DataDirectory = string.IsNullOrEmpty(dataDirectoryOverride)
+ ? ResolveWritableDataDirectory()
+ : Directory.CreateDirectory(dataDirectoryOverride).FullName;
+ DatabasePath = Path.Combine(DataDirectory, "varManager.sqlite");
+ ConnectionString = BuildConnectionString(DatabasePath);
+
+ bool freshDatabase = !File.Exists(DatabasePath);
+
+ // System.Data.SQLite creates the file automatically on Open.
+ CreateSchema();
+
+ if (freshDatabase)
+ {
+ string legacyMdb = FindLegacyMdb();
+ if (legacyMdb != null)
+ {
+ try
+ {
+ MigratedRowCount = MdbToSqliteMigrator.Migrate(legacyMdb, ConnectionString);
+ }
+ catch (Exception ex)
+ {
+ // ACE driver missing / unreadable mdb: keep the empty DB, let the
+ // app rebuild by rescanning. Record the reason for the user.
+ LastMigrationError = ex.Message;
+ TryLog("Legacy .mdb import failed: " + ex);
+ }
+ }
+ }
+ }
+
+ ///
+ /// Pick a directory we can actually write to. Prefer the exe folder (portable),
+ /// fall back to %LOCALAPPDATA%\varManager when it is read-only or unreachable
+ /// (e.g. exe on a network share while running elevated).
+ ///
+ private static string ResolveWritableDataDirectory()
+ {
+ string exeDir = AppContext.BaseDirectory;
+ // Prefer the exe folder only for LOCAL, writable installs. Never put the SQLite
+ // file on a network share (SMB locking is unreliable, and a mapped drive is
+ // invisible to this elevated process anyway).
+ if (!IsNetworkPath(exeDir) && IsDirectoryWritable(exeDir))
+ return exeDir;
+
+ string local = Path.Combine(
+ Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+ "varManager");
+ Directory.CreateDirectory(local);
+ return local;
+ }
+
+ private static bool IsDirectoryWritable(string dir)
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(dir) || !Directory.Exists(dir)) return false;
+ string probe = Path.Combine(dir, ".wtest_" + Guid.NewGuid().ToString("N"));
+ using (File.Create(probe)) { }
+ File.Delete(probe);
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ private static bool IsNetworkPath(string dir)
+ {
+ try
+ {
+ if (string.IsNullOrEmpty(dir)) return false;
+ if (dir.StartsWith(@"\\")) return true; // UNC
+ string root = Path.GetPathRoot(dir);
+ if (string.IsNullOrEmpty(root)) return false;
+ return new DriveInfo(root).DriveType == DriveType.Network;
+ }
+ catch
+ {
+ return false; // undetermined: let the write-test decide
+ }
+ }
+
+ /// Look for a legacy varManager.mdb in the data dir, then next to the exe.
+ private static string FindLegacyMdb()
+ {
+ foreach (var dir in new[] { DataDirectory, AppContext.BaseDirectory })
+ {
+ try
+ {
+ string p = Path.Combine(dir, "varManager.mdb");
+ if (File.Exists(p)) return p;
+ }
+ catch { /* inaccessible path (e.g. unmapped network drive) -> ignore */ }
+ }
+ return null;
+ }
+
+ private static void CreateSchema() => EnsureSchema(ConnectionString);
+
+ /// Create the varManager schema (tables/indexes/views) on the given SQLite
+ /// connection if missing. Idempotent. Used both on startup and by the migration tool.
+ public static void EnsureSchema(string connectionString)
+ {
+ string sql = ReadEmbeddedSchema();
+ using (var conn = new SQLiteConnection(connectionString))
+ {
+ conn.Open();
+ using (var tx = conn.BeginTransaction())
+ using (var cmd = new SQLiteCommand(sql, conn, tx))
+ {
+ cmd.ExecuteNonQuery();
+ tx.Commit();
+ }
+ }
+ }
+
+ ///
+ /// Build the SQLite connection string used everywhere (startup DB, migration targets,
+ /// tests) so every database gets the same performance profile:
+ /// WAL — readers don't block the writer; no rollback-journal churn.
+ /// Synchronous=Normal — with WAL, commits skip the per-commit fsync (safe: the DB
+ /// cannot corrupt; this is rebuildable index data).
+ /// Cache Size=-8192 — 8 MB page cache cap (negative = KB). Deliberately small and
+ /// deliberately NOT pooled: every form owns adapter instances with a
+ /// connection each, so pooled connections would keep their native page
+ /// caches alive for the whole process (opening the scene manager once
+ /// pinned hundreds of MB). Unpooled, the cache is freed at Close and
+ /// the OS file cache serves re-reads.
+ ///
+ public static string BuildConnectionString(string databaseFilePath)
+ => "Data Source=" + databaseFilePath +
+ ";Version=3;Journal Mode=WAL;Synchronous=Normal;Cache Size=-8192;";
+
+ private static string ReadEmbeddedSchema()
+ {
+ var asm = typeof(Db).Assembly;
+ string name = asm.GetManifestResourceNames()
+ .FirstOrDefault(n => n.EndsWith("schema.sql", StringComparison.OrdinalIgnoreCase));
+ if (name == null)
+ throw new InvalidOperationException("Embedded schema.sql not found in assembly manifest.");
+ using (var s = asm.GetManifestResourceStream(name))
+ using (var r = new StreamReader(s))
+ return r.ReadToEnd();
+ }
+
+ private static void TryLog(string message)
+ {
+ try
+ {
+ string dir = DataDirectory ?? AppContext.BaseDirectory;
+ File.AppendAllText(
+ Path.Combine(dir, "varManager.migration.log"),
+ DateTime.Now.ToString("s") + " " + message + Environment.NewLine);
+ }
+ catch { /* logging must never throw */ }
+ }
+ }
+}
diff --git a/varManager/Form1.Designer.cs b/varManager/Form1.Designer.cs
index 793da51..65137fe 100644
--- a/varManager/Form1.Designer.cs
+++ b/varManager/Form1.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class Form1
@@ -1547,7 +1547,7 @@ private void InitializeComponent()
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1540, 829);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("Cambria", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
diff --git a/varManager/Form1.cs b/varManager/Form1.cs
index f23748b..8089b91 100644
--- a/varManager/Form1.cs
+++ b/varManager/Form1.cs
@@ -42,10 +42,25 @@ public partial class Form1 : Form
private static string tempVarLinkDirName = "___TempVarLink___";
//private varManagerDataSet.dependenciesDataTable installedDependencies = new varManagerDataSet.dependenciesDataTable();
private InvokeAddLoglist addlog;
+ private bool closingDown;
+ private string baseTitle;
+
public Form1()
{
InitializeComponent();
addlog = new InvokeAddLoglist(UpdateAddLoglist);
+ // Smooth scrolling: DataGridView doesn't double-buffer by default, so the big
+ // vars grid flickered/stuttered on scroll (more visible under .NET 8 rendering).
+ // The DoubleBuffered property is protected, so set it via reflection.
+ EnableDoubleBuffer(varsViewDataGridView);
+ // Same teardown protection as FormScenes: .NET 8 enumerates virtual-list
+ // items at window destroy; with a large preview list that would re-enter
+ // RetrieveVirtualItem thousands of times during app exit.
+ this.FormClosing += (s, e) =>
+ {
+ closingDown = true;
+ listViewPreviewPics.VirtualListSize = 0;
+ };
}
private void buttonSetting_Click(object sender, EventArgs e)
@@ -568,34 +583,36 @@ private Dictionary GetInstalledVars()
}
private void UpdateVarsInstalled()
{
- foreach (var row in this.varManagerDataSet.installStatus)
- row.Delete();
- installStatusTableAdapter.Update(varManagerDataSet.installStatus);
- this.varManagerDataSet.installStatus.AcceptChanges();
- installStatusTableAdapter.DeleteAll();
- this.varManagerDataSet.installStatus.Clear();
- this.varManagerDataSet.installStatus.AcceptChanges();
mutex.WaitOne();
+
+ // Scan the file system FIRST while the old installStatus data is still in the DB.
+ // This prevents the "all vars show as uninstalled" flash that would occur if we
+ // cleared the DB before scanning.
+ var newRows = new System.Collections.Generic.List<(string varName, bool installed, bool disabled)>();
foreach (string varfile in GetInstalledVars().Values)
{
string varName = Path.GetFileNameWithoutExtension(varfile);
if (varManagerDataSet.vars.FindByvarName(varName) != null)
{
bool isdisable = File.Exists(varfile + ".disabled");
- varManagerDataSet.installStatus.AddinstallStatusRow(varName, true, isdisable);
+ newRows.Add((varName, true, isdisable));
}
}
- installStatusTableAdapter.Update(varManagerDataSet.installStatus);
- this.varManagerDataSet.installStatus.AcceptChanges();
+ // Atomic replace: DELETE + INSERT in one transaction.
+ // Concurrent DB readers (varsView Fill) see either the complete old state or
+ // the complete new state — never an empty gap.
+ installStatusTableAdapter.BulkReplace(newRows);
+
+ // Keep the in-memory DataTable in sync with the DB.
+ this.varManagerDataSet.installStatus.Clear();
+ foreach (var (varName, _, disabled) in newRows)
+ varManagerDataSet.installStatus.AddinstallStatusRow(varName, true, disabled);
+ varManagerDataSet.installStatus.AcceptChanges();
+
mutex.ReleaseMutex();
- // TODO: 这行代码将数据加载到表“varManagerDataSet1.varsView”中。您可以根据需要移动或删除它。
- //varsViewBindingSource.ResetBindings(true);
- InvokeUpdateVarsViewDataGridView invokeUpdateVarsViewDataGridView = new InvokeUpdateVarsViewDataGridView(UpdateVarsViewDataGridView);
- this.BeginInvoke(invokeUpdateVarsViewDataGridView);
-
- //varsViewDataGridView.Update();
+ this.BeginInvoke(new InvokeUpdateVarsViewDataGridView(UpdateVarsViewDataGridView));
}
private Mutex mutex;
private System.Threading.Mutex mut = new Mutex();
@@ -612,12 +629,9 @@ private void Form1_Load(object sender, EventArgs e)
this.Close();
return;
}
- // TODO: 这行代码将数据加载到表“varManagerDataSet.installStatus”中。您可以根据需要移动或删除它。
+ // TODO: 这行代码将数据加载到表"varManagerDataSet.installStatus"中。您可以根据需要移动或删除它。
//this.installStatusTableAdapter.DeleteAll();
mutex = new System.Threading.Mutex();
-
- backgroundWorkerInstall.RunWorkerAsync("FillDataTables");
- //
string varspath = new DirectoryInfo(Settings.Default.varspath).FullName.ToLower();
string packpath = new DirectoryInfo(Path.Combine(Settings.Default.vampath, "AddonPackages")).FullName;
@@ -689,37 +703,71 @@ private void Form1_Load(object sender, EventArgs e)
//dtstart = DateTime.Now;
//string[] packswitchdirs = Directory.GetDirectories(packsSwitchpath, "*", SearchOption.TopDirectoryOnly);
- UpdateVarsInstalled();
- comboBoxCreater.Items.Add("____ALL");
- foreach (var row in this.varManagerDataSet.vars.GroupBy(g => g.creatorName))
+ dgvFilterManager = new DgvFilterManager(varsViewDataGridView);
+ baseTitle = this.Text;
+ // Heavy startup work (DB load, installStatus reconcile) runs in background.
+ // Started only AFTER the AddonPackages symlink setup above, so the worker's
+ // symlink scan cannot race the link creation. Grid render, comboBoxCreater
+ // population and the unorganized-vars check happen in RunWorkerCompleted.
+ RunBackgroundTask("FillDataTables");
+ }
+
+ /// Turn on double buffering for a control whose DoubleBuffered property is
+ /// protected (DataGridView/ListView) so scrolling/redraw is smooth.
+ private static void EnableDoubleBuffer(System.Windows.Forms.Control c)
+ {
+ try
{
- comboBoxCreater.Items.Add(row.Key);
+ typeof(System.Windows.Forms.Control).GetProperty("DoubleBuffered",
+ System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
+ ?.SetValue(c, true, null);
}
- comboBoxCreater.SelectedIndex = 0;
- // FillDataTables();
- //TimeSpan ts6 = DateTime.Now - dtstart;
- //dtstart = DateTime.Now;
- //MessageBox.Show($"{ts1.TotalSeconds},{ts2.TotalSeconds},{ts3.TotalSeconds},{ts4.TotalSeconds},{ts5.TotalSeconds},{ts6.TotalSeconds}");
- dgvFilterManager = new DgvFilterManager(varsViewDataGridView);
- if (ExistAddonpackagesVar())
+ catch { /* non-fatal cosmetic optimization */ }
+ }
+
+ ///
+ /// Single gate for every backgroundWorkerInstall task. The worker is shared by ~11
+ /// features (UpdDB, rebuild symlink, fix preview, missing-depends, …); the original
+ /// code called RunWorkerAsync directly, so starting a second task while one was still
+ /// running threw "This BackgroundWorker is currently busy" and crashed. This refuses
+ /// politely when busy and shows a running indicator in the title bar.
+ ///
+ private bool RunBackgroundTask(string arg)
+ {
+ if (backgroundWorkerInstall.IsBusy)
{
- MessageBox.Show("There are unorganized var files in the current switch, please run UPD_DB first");
- buttonUpdDB.Focus();
+ MessageBox.Show("后台正在执行其他操作,请等待当前任务完成后再试。\n(标题栏会显示当前正在运行的任务)",
+ "请稍候", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ return false;
}
+ SetBusyUi(true, arg);
+ backgroundWorkerInstall.RunWorkerAsync(arg);
+ return true;
+ }
+
+ private void SetBusyUi(bool busy, string taskName = null)
+ {
+ this.UseWaitCursor = busy;
+ if (!string.IsNullOrEmpty(baseTitle))
+ this.Text = busy ? baseTitle + " — 正在执行: " + taskName + " …" : baseTitle;
}
private void FillDataTables()
{
this.BeginInvoke(addlog, new Object[] { $"load vars...", LogLevel.INFO });
- // TODO: 这行代码将数据加载到表“varManagerDataSet.vars”中。您可以根据需要移动或删除它。
+ // TODO: 这行代码将数据加载到表"varManagerDataSet.vars"中。您可以根据需要移动或删除它。
this.varsTableAdapter.Fill(this.varManagerDataSet.vars);
this.BeginInvoke(addlog, new Object[] { $"load scenes...", LogLevel.INFO });
- // TODO: 这行代码将数据加载到表“varManagerDataSet.scenes”中。您可以根据需要移动或删除它。
+ // TODO: 这行代码将数据加载到表"varManagerDataSet.scenes"中。您可以根据需要移动或删除它。
this.scenesTableAdapter.Fill(this.varManagerDataSet.scenes);
this.BeginInvoke(addlog, new Object[] { $"load dependencies...", LogLevel.INFO });
- // TODO: 这行代码将数据加载到表“varManagerDataSet.dependencies”中。您可以根据需要移动或删除它。
+ // TODO: 这行代码将数据加载到表"varManagerDataSet.dependencies"中。您可以根据需要移动或删除它。
this.dependenciesTableAdapter.Fill(this.varManagerDataSet.dependencies);
-
+ // The in-memory installStatus table is read by install/uninstall/switch logic
+ // (FindByvarName etc.). Load the persisted state immediately so those paths see
+ // the last-known truth even before the filesystem reconcile below finishes.
+ this.BeginInvoke(addlog, new Object[] { $"load install status...", LogLevel.INFO });
+ this.installStatusTableAdapter.Fill(this.varManagerDataSet.installStatus);
}
public delegate void InvokeUpdateVarsViewDataGridView();
@@ -806,7 +854,7 @@ private void buttonUpdDB_Click(object sender, EventArgs e)
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
- backgroundWorkerInstall.RunWorkerAsync("UpdDB");
+ RunBackgroundTask("UpdDB");
}
private void UpdDB(string destvarfilename)
@@ -818,6 +866,20 @@ private void UpdDB(string destvarfilename)
curpath = Comm.MakeRelativePath(Settings.Default.varspath, curpath);
var varsrow = varManagerDataSet.vars.FindByvarName(basename);
+ // Detect changed vars: same filename but filesize differs → content replaced.
+ // Re-import by treating as new (CleanVar removes the stale record first).
+ if (varsrow != null && !varsrow.IsfilesizeNull())
+ {
+ long diskSize = new FileInfo(destvarfilename).Length;
+ if ((long)varsrow.filesize != diskSize)
+ {
+ this.BeginInvoke(addlog, new Object[] {
+ $"{basename}: filesize changed ({(long)varsrow.filesize} → {diskSize}), re-importing",
+ LogLevel.INFO });
+ CleanVar(basename);
+ varsrow = null;
+ }
+ }
if (varsrow == null)
{
ZipFile varzipfile;
@@ -1256,19 +1318,22 @@ private void backgroundWorkerInstall_DoWork(object sender, DoWorkEventArgs e)
mutex.WaitOne();
if ((string)e.Argument == "FillDataTables")
{
- /*
- Thread thread1 = new Thread(new ThreadStart(fillscenes));
- thread1.Start();
- Thread thread2 = new Thread(new ThreadStart(fillvars));
- thread2.Start();
- Thread thread3 = new Thread(new ThreadStart(filldependencies));
- thread3.Start();
- thread1.Join();
- thread2.Join();
- thread3.Join();
- */
+ var sw = System.Diagnostics.Stopwatch.StartNew();
FillDataTables();
- }
+ long fillMs = sw.ElapsedMilliseconds;
+ this.BeginInvoke(addlog, new object[] {
+ $"DB load: {fillMs}ms",
+ LogLevel.INFO });
+ // Reconcile install state with the actual AddonPackages symlinks (the
+ // original app did this on startup; it catches changes made outside the
+ // app). Still off the UI thread; BulkReplace keeps it a single transaction.
+ sw.Restart();
+ UpdateVarsInstalled();
+ this.BeginInvoke(addlog, new object[] {
+ $"install-status reconcile: {sw.ElapsedMilliseconds}ms",
+ LogLevel.INFO });
+ e.Result = "FillDataTables";
+ }
if ((string)e.Argument == "UpdDB")
{
TidyVars();
@@ -1340,7 +1405,30 @@ private void backgroundWorkerInstall_DoWork(object sender, DoWorkEventArgs e)
private void backgroundWorkerInstall_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
-
+ SetBusyUi(false);
+ if (e.Error != null)
+ {
+ MessageBox.Show("后台任务出错: " + e.Error.Message);
+ return;
+ }
+ if (e.Result is string s && s == "FillDataTables")
+ {
+ // Startup complete: render table from persisted SQLite data.
+ UpdateVarsViewDataGridView();
+ comboBoxCreater.Items.Clear();
+ comboBoxCreater.Items.Add("____ALL");
+ foreach (var row in this.varManagerDataSet.vars.GroupBy(g => g.creatorName))
+ comboBoxCreater.Items.Add(row.Key);
+ if (comboBoxCreater.Items.Count > 0)
+ comboBoxCreater.SelectedIndex = 0;
+ // Original startup behaviour: warn when AddonPackages holds real (non-link)
+ // var files that the manager doesn't know about yet.
+ if (ExistAddonpackagesVar())
+ {
+ MessageBox.Show("There are unorganized var files in the current switch, please run UPD_DB first");
+ buttonUpdDB.Focus();
+ }
+ }
}
private void buttonMissingDepends_Click(object sender, EventArgs e)
@@ -1354,7 +1442,7 @@ private void buttonMissingDepends_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
- backgroundWorkerInstall.RunWorkerAsync("MissingDepends");
+ RunBackgroundTask("MissingDepends");
}
}
@@ -1450,7 +1538,7 @@ private void buttonAllMissingDepends_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
- backgroundWorkerInstall.RunWorkerAsync("AllMissingDepends");
+ RunBackgroundTask("AllMissingDepends");
}
}
public void AllMissingDepends()
@@ -1712,7 +1800,7 @@ private void buttonFixRebuildLink_Click(object sender, EventArgs e)
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
- backgroundWorkerInstall.RunWorkerAsync("rebuildLink");
+ RunBackgroundTask("rebuildLink");
}
private void buttonFixSavesDepend_Click(object sender, EventArgs e)
@@ -1725,7 +1813,7 @@ private void buttonFixSavesDepend_Click(object sender, EventArgs e)
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
- backgroundWorkerInstall.RunWorkerAsync("savesDepend");
+ RunBackgroundTask("savesDepend");
}
private void comboBoxCreater_SelectedIndexChanged(object sender, EventArgs e)
@@ -2007,19 +2095,12 @@ public void PreviewPics(string varname,
{
if (string.IsNullOrWhiteSpace(picpath))
{
- imageListPreviewPics.Images.Add(Image.FromFile("vam.png"));
+ Comm.AddImageToList(imageListPreviewPics, null, "vam.png");
}
else
{
picpath = Path.Combine(Settings.Default.varspath, previewpicsDirName, typename, varname, picpath);
- if (File.Exists(picpath))
- {
- imageListPreviewPics.Images.Add(Image.FromFile(picpath));
- }
- else
- {
- imageListPreviewPics.Images.Add(Image.FromFile("vam.png"));
- }
+ Comm.AddImageToList(imageListPreviewPics, null, File.Exists(picpath) ? picpath : "vam.png");
}
var item = listViewPreviewPics.Items.Add(Path.GetFileNameWithoutExtension(picpath), imageListPreviewPics.Images.Count - 1);
item.SubItems.Add(varname);
@@ -2033,6 +2114,7 @@ public void PreviewPics(string varname,
private void listViewPreviewPics_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
+ if (closingDown) { e.Item = new ListViewItem(string.Empty); return; }
var curpriviewpic = previewpicsfilter[e.ItemIndex];
string key = "vam.png";
if (!string.IsNullOrWhiteSpace(curpriviewpic.Picpath))
@@ -2049,8 +2131,10 @@ private void listViewPreviewPics_RetrieveVirtualItem(object sender, RetrieveVirt
}
if (!imageListPreviewPics.Images.ContainsKey(key))
{
- imageListPreviewPics.Images.Add(key, Image.FromFile(key));
- if (imageListPreviewPics.Images.Count > 20) imageListPreviewPics.Images.RemoveAt(0);
+ Comm.AddImageToList(imageListPreviewPics, key, key);
+ // see FormScenes.RetrieveVirtualItem: hysteresis cap, sized above the
+ // visible tile count so the scroll cache stops thrashing/leaking.
+ Comm.TrimImageList(imageListPreviewPics, 256, 192);
}
string itemname = Path.GetFileNameWithoutExtension(curpriviewpic.Picpath);
if(string.IsNullOrEmpty(itemname))
@@ -2182,9 +2266,9 @@ private void buttonStaleVars_Click(object sender, EventArgs e)
if (formStaleVars.ShowDialog() == DialogResult.OK)
{
if (formStaleVars.removeOldVersion)
- backgroundWorkerInstall.RunWorkerAsync("OldVersionVars");
+ RunBackgroundTask("OldVersionVars");
else
- backgroundWorkerInstall.RunWorkerAsync("StaleVars");
+ RunBackgroundTask("StaleVars");
}
}
@@ -2239,7 +2323,7 @@ void StaleVars()
}
}
}
- System.Diagnostics.Process.Start(stalepath);
+ Comm.OpenShell(stalepath);
//MessageBox.Show("Please run upd-db once");
}
@@ -2296,7 +2380,7 @@ void OldVersionVars()
}
}
- System.Diagnostics.Process.Start(oldversionpath);
+ Comm.OpenShell(oldversionpath);
//MessageBox.Show("Please run upd-db once");
}
@@ -2425,12 +2509,6 @@ private void buttonInstall_Click(object sender, EventArgs e)
}
}
if (varNames.Count <= 0) return;
- int max = 500;
- if (varNames.Count > max)
- {
- MessageBox.Show($"Please do not install more than {max} files at once");
- return;
- }
string message = $"There are {varNames.Count} vars and their dependencies will be installed, are you sure?";
string caption = "Install Var";
var result = MessageBox.Show(message, caption,
@@ -2439,12 +2517,19 @@ private void buttonInstall_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes)
{
- varNames = VarsDependencies(varNames);
- foreach (string varname in varNames)
+ // No 500-row cap anymore: symlink creation is cheap and DB persistence is
+ // batched under one SQLite transaction. Wait cursor covers the sync work.
+ this.UseWaitCursor = true;
+ try
{
- VarInstall(varname);
+ varNames = VarsDependencies(varNames);
+ foreach (string varname in varNames)
+ {
+ VarInstall(varname);
+ }
+ UpdateVarsInstalled();
}
- UpdateVarsInstalled();
+ finally { this.UseWaitCursor = false; }
}
}
public List GetDependents(string dependName)
@@ -2495,9 +2580,9 @@ private void listViewPreviewPics_Click(object sender, EventArgs e)
curEntryName = item.SubItems[5].Text;
labelPreviewVarName.Text = curVarName;
if (string.IsNullOrEmpty(item.SubItems[2].Text))
- pictureBoxPreview.Image = pictureBoxPreview.Image = Image.FromFile("vam.png");
+ Comm.SwapPictureBoxImage(pictureBoxPreview, "vam.png");
else
- pictureBoxPreview.Image = Image.FromFile(item.SubItems[2].Text);
+ Comm.SwapPictureBoxImage(pictureBoxPreview, item.SubItems[2].Text);
if (item.SubItems[3].Text.ToLower() == "true")
{
@@ -2575,7 +2660,7 @@ private void listViewPreviewPics_Click(object sender, EventArgs e)
private void UpdateButtonClearCache()
{
- string sceneCacheFolderName = Path.Combine(Directory.GetCurrentDirectory(), "Cache",
+ string sceneCacheFolderName = Path.Combine(Comm.CacheDir,
Comm.ValidFileName(curVarName), Comm.ValidFileName(curEntryName.Replace('\\', '_').Replace('/', '_')));
if (Directory.Exists(sceneCacheFolderName))
{
@@ -2618,7 +2703,7 @@ private void buttonLogAnalysis_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
- backgroundWorkerInstall.RunWorkerAsync("LogAnalysis");
+ RunBackgroundTask("LogAnalysis");
}
}
@@ -2632,7 +2717,7 @@ private void LogAnalysis()
var metajsonsteam = new StreamReader(logfile);
string logstring = metajsonsteam.ReadToEnd();
metajsonsteam.Close();
- System.Diagnostics.Process.Start(logfile);
+ Comm.OpenShell(logfile);
List dependencies = new List();
try
{
@@ -2697,12 +2782,6 @@ private void buttonUninstallSels_Click(object sender, EventArgs e)
}
}
if (varNames.Count <= 0) return;
- int max = 500;
- if (varNames.Count > max)
- {
- MessageBox.Show($"Please do not uninstall more than {max} files at once");
- return;
- }
string message = $"There are {varNames.Count} vars and their dependencies will be Uninstall, are you sure?";
string caption = "Uninstall Vars";
var result = MessageBox.Show(message, caption,
@@ -2711,8 +2790,13 @@ private void buttonUninstallSels_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes)
{
- UnintallVars(varNames);
- UpdateVarsInstalled();
+ this.UseWaitCursor = true;
+ try
+ {
+ UnintallVars(varNames);
+ UpdateVarsInstalled();
+ }
+ finally { this.UseWaitCursor = false; }
}
}
@@ -2726,7 +2810,9 @@ private void buttonDelete_Click(object sender, EventArgs e)
varNames.Add(varName);
}
if (varNames.Count <= 0) return;
- int max = 50;
+ // Delete physically removes var files — keep a generous guard (raised from 50)
+ // against a fat-finger "select all + delete", but no longer the old tiny cap.
+ int max = 5000;
if (varNames.Count > max)
{
MessageBox.Show($"Please do not delete more than {max} files at once");
@@ -2740,9 +2826,14 @@ private void buttonDelete_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes)
{
- DeleteVars(varNames);
- UpdateVarsInstalled();
- RescanPackages();
+ this.UseWaitCursor = true;
+ try
+ {
+ DeleteVars(varNames);
+ UpdateVarsInstalled();
+ RescanPackages();
+ }
+ finally { this.UseWaitCursor = false; }
}
}
@@ -3000,7 +3091,7 @@ public void LoadScene(JSONClass jc,bool merge, bool ignoreGender, string charact
JSONClass resource = (JSONClass)resources[0];
saveName = resource["saveName"].Value;
(string varName, string entryName) = SaveNameSplit(saveName);
- string sceneFolder = Path.Combine(Directory.GetCurrentDirectory(), "Cache",
+ string sceneFolder = Path.Combine(Comm.CacheDir,
Comm.ValidFileName(varName), Comm.ValidFileName(entryName.Replace('\\', '_').Replace('/', '_')));
string dependfFilename = Path.Combine(sceneFolder, "depend.txt");
if (!File.Exists(dependfFilename))
@@ -3250,7 +3341,7 @@ public void Analysisscene(JSONClass jsonLS)
JSONClass resource = (JSONClass)resources[0];
saveName = resource["saveName"].Value;
(string varName, string entryName) = SaveNameSplit(saveName);
- string sceneFolder = Path.Combine(Directory.GetCurrentDirectory(), "Cache",
+ string sceneFolder = Path.Combine(Comm.CacheDir,
Comm.ValidFileName(varName), Comm.ValidFileName(entryName.Replace('\\', '_').Replace('/', '_')));
string atomsFoldername = Path.Combine(sceneFolder, "atoms");
@@ -3352,7 +3443,7 @@ public bool ReadSaveName(string saveName,string characterGender,bool analysis=fa
}
depends.AddRange(Getdependencies(jsonscene));
- string sceneFolder = Path.Combine(Directory.GetCurrentDirectory(), "Cache",
+ string sceneFolder = Path.Combine(Comm.CacheDir,
Comm.ValidFileName(varName), Comm.ValidFileName(entryName.Replace('\\', '_').Replace('/', '_')));
Directory.CreateDirectory(sceneFolder);
string dependFilename = Path.Combine(sceneFolder, "depend.txt");
@@ -3520,7 +3611,7 @@ private void buttonFixPreview_Click(object sender, EventArgs e)
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
- backgroundWorkerInstall.RunWorkerAsync("fixPreview");
+ RunBackgroundTask("fixPreview");
}
private void buttonHub_Click(object sender, EventArgs e)
@@ -3573,7 +3664,7 @@ private void buttonFilteredMissingDepends_Click(object sender, EventArgs e)
MessageBoxDefaultButton.Button1);
if (result == DialogResult.Yes)
{
- backgroundWorkerInstall.RunWorkerAsync("FilteredMissingDepends");
+ RunBackgroundTask("FilteredMissingDepends");
}
}
@@ -3581,7 +3672,7 @@ private void buttonClearCache_Click(object sender, EventArgs e)
{
if (MessageBox.Show("The cache can improve the speed of secondary analysis, normally you don't need to clear it, unless you modify the scene file. This operation only clears the cache of the current scene, if you need to clear all the cache, please delete the cache directory manually.", "Clear Cache", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
- string sceneFoldername = Path.Combine(Directory.GetCurrentDirectory(), "Cache",
+ string sceneFoldername = Path.Combine(Comm.CacheDir,
Comm.ValidFileName(curVarName), Comm.ValidFileName(curEntryName.Replace('\\', '_').Replace('/', '_')));
try { Directory.Delete(sceneFoldername, true); }
catch { }
diff --git a/varManager/Form2.Designer.cs b/varManager/Form2.Designer.cs
index 54f1792..9fb05f3 100644
--- a/varManager/Form2.Designer.cs
+++ b/varManager/Form2.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class Form2
@@ -30,7 +30,7 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form2";
}
diff --git a/varManager/FormAnalysis.Designer.cs b/varManager/FormAnalysis.Designer.cs
index d9996c7..3dc3c34 100644
--- a/varManager/FormAnalysis.Designer.cs
+++ b/varManager/FormAnalysis.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class FormAnalysis
{
@@ -388,7 +388,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonLoadLook;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonExit;
this.ClientSize = new System.Drawing.Size(541, 534);
this.ControlBox = false;
diff --git a/varManager/FormHub.Designer.cs b/varManager/FormHub.Designer.cs
index 5f77f65..7a20912 100644
--- a/varManager/FormHub.Designer.cs
+++ b/varManager/FormHub.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class FormHub
{
@@ -596,7 +596,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonClose;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1024, 751);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("Cambria", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
diff --git a/varManager/FormMigrate.Designer.cs b/varManager/FormMigrate.Designer.cs
new file mode 100644
index 0000000..2a34207
--- /dev/null
+++ b/varManager/FormMigrate.Designer.cs
@@ -0,0 +1,140 @@
+namespace varManager
+{
+ partial class FormMigrate
+ {
+ private System.ComponentModel.IContainer components = null;
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null)) components.Dispose();
+ base.Dispose(disposing);
+ }
+
+ private void InitializeComponent()
+ {
+ this.lblSource = new System.Windows.Forms.Label();
+ this.txtSource = new System.Windows.Forms.TextBox();
+ this.btnBrowseSource = new System.Windows.Forms.Button();
+ this.lblTarget = new System.Windows.Forms.Label();
+ this.txtTarget = new System.Windows.Forms.TextBox();
+ this.btnBrowseTarget = new System.Windows.Forms.Button();
+ this.chkClear = new System.Windows.Forms.CheckBox();
+ this.btnStart = new System.Windows.Forms.Button();
+ this.progressBar = new System.Windows.Forms.ProgressBar();
+ this.txtLog = new System.Windows.Forms.TextBox();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ // lblSource
+ this.lblSource.AutoSize = true;
+ this.lblSource.Location = new System.Drawing.Point(12, 15);
+ this.lblSource.Name = "lblSource";
+ this.lblSource.Size = new System.Drawing.Size(250, 17);
+ this.lblSource.Text = "源:旧版 Access 库(varManager.mdb)或其所在文件夹";
+ // txtSource
+ this.txtSource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtSource.Location = new System.Drawing.Point(12, 36);
+ this.txtSource.Name = "txtSource";
+ this.txtSource.Size = new System.Drawing.Size(516, 23);
+ // btnBrowseSource
+ this.btnBrowseSource.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowseSource.Location = new System.Drawing.Point(536, 35);
+ this.btnBrowseSource.Name = "btnBrowseSource";
+ this.btnBrowseSource.Size = new System.Drawing.Size(104, 26);
+ this.btnBrowseSource.Text = "浏览…";
+ this.btnBrowseSource.UseVisualStyleBackColor = true;
+ this.btnBrowseSource.Click += new System.EventHandler(this.btnBrowseSource_Click);
+ // lblTarget
+ this.lblTarget.AutoSize = true;
+ this.lblTarget.Location = new System.Drawing.Point(12, 72);
+ this.lblTarget.Name = "lblTarget";
+ this.lblTarget.Size = new System.Drawing.Size(220, 17);
+ this.lblTarget.Text = "目标:新版 SQLite 库(varManager.sqlite)";
+ // txtTarget
+ this.txtTarget.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtTarget.Location = new System.Drawing.Point(12, 93);
+ this.txtTarget.Name = "txtTarget";
+ this.txtTarget.Size = new System.Drawing.Size(516, 23);
+ // btnBrowseTarget
+ this.btnBrowseTarget.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBrowseTarget.Location = new System.Drawing.Point(536, 92);
+ this.btnBrowseTarget.Name = "btnBrowseTarget";
+ this.btnBrowseTarget.Size = new System.Drawing.Size(104, 26);
+ this.btnBrowseTarget.Text = "浏览…";
+ this.btnBrowseTarget.UseVisualStyleBackColor = true;
+ this.btnBrowseTarget.Click += new System.EventHandler(this.btnBrowseTarget_Click);
+ // chkClear
+ this.chkClear.AutoSize = true;
+ this.chkClear.Checked = true;
+ this.chkClear.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkClear.Location = new System.Drawing.Point(12, 128);
+ this.chkClear.Name = "chkClear";
+ this.chkClear.Size = new System.Drawing.Size(280, 21);
+ this.chkClear.Text = "迁移前清空目标表(全量覆盖,推荐)";
+ this.chkClear.UseVisualStyleBackColor = true;
+ // btnStart
+ this.btnStart.Location = new System.Drawing.Point(12, 158);
+ this.btnStart.Name = "btnStart";
+ this.btnStart.Size = new System.Drawing.Size(120, 32);
+ this.btnStart.Text = "开始迁移";
+ this.btnStart.UseVisualStyleBackColor = true;
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+ // progressBar
+ this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
+ this.progressBar.Location = new System.Drawing.Point(150, 161);
+ this.progressBar.Name = "progressBar";
+ this.progressBar.Size = new System.Drawing.Size(490, 26);
+ this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
+ // txtLog
+ this.txtLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtLog.Font = new System.Drawing.Font("Consolas", 9F);
+ this.txtLog.Location = new System.Drawing.Point(12, 200);
+ this.txtLog.Multiline = true;
+ this.txtLog.Name = "txtLog";
+ this.txtLog.ReadOnly = true;
+ this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.txtLog.Size = new System.Drawing.Size(628, 262);
+ // btnClose
+ this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnClose.Location = new System.Drawing.Point(536, 470);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(104, 30);
+ this.btnClose.Text = "关闭";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ // FormMigrate
+ this.AcceptButton = this.btnStart;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.ClientSize = new System.Drawing.Size(652, 512);
+ this.Controls.Add(this.btnClose);
+ this.Controls.Add(this.txtLog);
+ this.Controls.Add(this.progressBar);
+ this.Controls.Add(this.btnStart);
+ this.Controls.Add(this.chkClear);
+ this.Controls.Add(this.btnBrowseTarget);
+ this.Controls.Add(this.txtTarget);
+ this.Controls.Add(this.lblTarget);
+ this.Controls.Add(this.btnBrowseSource);
+ this.Controls.Add(this.txtSource);
+ this.Controls.Add(this.lblSource);
+ this.MinimumSize = new System.Drawing.Size(540, 420);
+ this.Name = "FormMigrate";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "从旧版(Access)迁移数据";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+ }
+
+ private System.Windows.Forms.Label lblSource;
+ private System.Windows.Forms.TextBox txtSource;
+ private System.Windows.Forms.Button btnBrowseSource;
+ private System.Windows.Forms.Label lblTarget;
+ private System.Windows.Forms.TextBox txtTarget;
+ private System.Windows.Forms.Button btnBrowseTarget;
+ private System.Windows.Forms.CheckBox chkClear;
+ private System.Windows.Forms.Button btnStart;
+ private System.Windows.Forms.ProgressBar progressBar;
+ private System.Windows.Forms.TextBox txtLog;
+ private System.Windows.Forms.Button btnClose;
+ }
+}
diff --git a/varManager/FormMigrate.cs b/varManager/FormMigrate.cs
new file mode 100644
index 0000000..c918c04
--- /dev/null
+++ b/varManager/FormMigrate.cs
@@ -0,0 +1,172 @@
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace varManager
+{
+ ///
+ /// In-app tool to import data from a legacy Access varManager.mdb into the new
+ /// SQLite database. The user picks the source (.mdb or its folder) and the target
+ /// (.sqlite) explicitly, so it works regardless of where the old/new installs live.
+ /// Runs on a background thread with live progress. Requires the ACE OLEDB provider to
+ /// read the .mdb.
+ ///
+ public partial class FormMigrate : Form
+ {
+ private bool _running;
+
+ public FormMigrate()
+ {
+ InitializeComponent();
+ // Default the target to the database the running app actually uses.
+ txtTarget.Text = Db.DatabasePath ?? "";
+ }
+
+ private void btnBrowseSource_Click(object sender, EventArgs e)
+ {
+ using (var dlg = new OpenFileDialog())
+ {
+ dlg.Title = "选择旧版 Access 数据库";
+ dlg.Filter = "varManager 数据库 (varManager.mdb;*.mdb)|varManager.mdb;*.mdb|所有文件 (*.*)|*.*";
+ dlg.CheckFileExists = true;
+ try { if (!string.IsNullOrEmpty(txtSource.Text)) dlg.InitialDirectory = Path.GetDirectoryName(txtSource.Text); } catch { }
+ if (dlg.ShowDialog(this) == DialogResult.OK)
+ txtSource.Text = dlg.FileName;
+ }
+ }
+
+ private void btnBrowseTarget_Click(object sender, EventArgs e)
+ {
+ using (var dlg = new OpenFileDialog())
+ {
+ dlg.Title = "选择目标 SQLite 数据库(可选择已有文件或输入新文件名)";
+ dlg.Filter = "SQLite 数据库 (*.sqlite)|*.sqlite|所有文件 (*.*)|*.*";
+ dlg.CheckFileExists = false;
+ dlg.CheckPathExists = true;
+ try
+ {
+ if (!string.IsNullOrEmpty(txtTarget.Text))
+ {
+ dlg.InitialDirectory = Path.GetDirectoryName(txtTarget.Text);
+ dlg.FileName = Path.GetFileName(txtTarget.Text);
+ }
+ }
+ catch { }
+ if (dlg.ShowDialog(this) == DialogResult.OK)
+ txtTarget.Text = dlg.FileName;
+ }
+ }
+
+ private async void btnStart_Click(object sender, EventArgs e)
+ {
+ string src = (txtSource.Text ?? "").Trim().Trim('"');
+ string dst = (txtTarget.Text ?? "").Trim().Trim('"');
+
+ // Allow picking the old program folder instead of the file itself.
+ if (Directory.Exists(src))
+ src = Path.Combine(src, "varManager.mdb");
+
+ if (!File.Exists(src))
+ {
+ MessageBox.Show(this, "找不到源 .mdb 文件:\n" + src, "varManager", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ return;
+ }
+ if (string.IsNullOrEmpty(dst))
+ {
+ MessageBox.Show(this, "请填写目标 SQLite 文件路径。", "varManager", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ return;
+ }
+ bool clear = chkClear.Checked;
+ if (clear && MessageBox.Show(this,
+ "将先清空目标库的 vars / scenes / installStatus / dependencies / savedepens 等表,再从旧库全量导入。\n\n确定继续?",
+ "确认全量覆盖", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
+ return;
+
+ SetRunning(true);
+ txtLog.Clear();
+ Log("源 : " + src);
+ Log("目标: " + dst);
+ Log(clear ? "模式: 全量覆盖(先清空目标表)" : "模式: 追加导入");
+ Log("----------------------------------------");
+
+ string connStr = Db.BuildConnectionString(dst);
+ MigrateResult result = null;
+ Exception error = null;
+ try
+ {
+ result = await Task.Run(() => MdbToSqliteMigrator.MigrateFull(src, connStr, clear, Log));
+ }
+ catch (Exception ex) { error = ex; }
+
+ SetRunning(false);
+
+ if (error != null)
+ {
+ Log("迁移失败: " + error.Message);
+ MessageBox.Show(this,
+ "迁移失败:\n" + error.Message +
+ "\n\n(读取 .mdb 需要安装 Microsoft Access Database Engine / ACE OLEDB 驱动。)",
+ "varManager", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ Log("========== 汇总 ==========");
+ foreach (var t in result.Tables)
+ Log(string.Format("{0,-14} 读取 {1,8} 写入 {2,8}{3}",
+ t.Table, t.Read, t.Inserted, t.Error != null ? " 错误: " + t.Error : ""));
+ Log("合计写入 " + result.TotalInserted + " 行。");
+
+ string msg = "迁移完成,共写入 " + result.TotalInserted + " 行。";
+ try
+ {
+ if (!string.IsNullOrEmpty(Db.DatabasePath) &&
+ string.Equals(Path.GetFullPath(dst), Path.GetFullPath(Db.DatabasePath), StringComparison.OrdinalIgnoreCase))
+ msg += "\n\n目标即当前程序数据库——请重启 varManager 以加载新数据。";
+ }
+ catch { }
+ MessageBox.Show(this, msg, "varManager", MessageBoxButtons.OK,
+ result.HasErrors ? MessageBoxIcon.Warning : MessageBoxIcon.Information);
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ if (!_running) Close();
+ }
+
+ protected override void OnFormClosing(FormClosingEventArgs e)
+ {
+ if (_running)
+ {
+ e.Cancel = true;
+ return;
+ }
+ base.OnFormClosing(e);
+ }
+
+ private void SetRunning(bool running)
+ {
+ _running = running;
+ txtSource.Enabled = !running;
+ btnBrowseSource.Enabled = !running;
+ txtTarget.Enabled = !running;
+ btnBrowseTarget.Enabled = !running;
+ chkClear.Enabled = !running;
+ btnStart.Enabled = !running;
+ btnClose.Enabled = !running;
+ progressBar.Style = running ? ProgressBarStyle.Marquee : ProgressBarStyle.Continuous;
+ progressBar.MarqueeAnimationSpeed = running ? 30 : 0;
+ Cursor = running ? Cursors.AppStarting : Cursors.Default;
+ }
+
+ private void Log(string message)
+ {
+ if (txtLog.IsHandleCreated && txtLog.InvokeRequired)
+ {
+ txtLog.BeginInvoke((Action)(() => Log(message)));
+ return;
+ }
+ txtLog.AppendText(message + Environment.NewLine);
+ }
+ }
+}
diff --git a/varManager/FormMissingVars.Designer.cs b/varManager/FormMissingVars.Designer.cs
index 72cd002..20ce7d3 100644
--- a/varManager/FormMissingVars.Designer.cs
+++ b/varManager/FormMissingVars.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormMissingVars
@@ -661,7 +661,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(1328, 569);
this.ControlBox = false;
diff --git a/varManager/FormMissingVars.cs b/varManager/FormMissingVars.cs
index a0e17ca..d34a7b0 100644
--- a/varManager/FormMissingVars.cs
+++ b/varManager/FormMissingVars.cs
@@ -160,7 +160,7 @@ private void dataGridViewMissingVars_CellContentClick(object sender, DataGridVie
if (e.ColumnIndex == 3)
{
string varname = dataGridViewMissingVars.Rows[e.RowIndex].Cells[0].Value.ToString().Replace(".latest", ".1");
- System.Diagnostics.Process.Start("https://www.google.com/search?q=" + varname + " var");
+ Comm.OpenShell("https://www.google.com/search?q=" + varname + " var");
}
}
diff --git a/varManager/FormScenes.Designer.cs b/varManager/FormScenes.Designer.cs
index 1a18f85..ad3876e 100644
--- a/varManager/FormScenes.Designer.cs
+++ b/varManager/FormScenes.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormScenes
@@ -926,7 +926,7 @@ private void InitializeComponent()
// FormScenes
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1324, 672);
this.Controls.Add(this.panelImage);
this.Controls.Add(this.tableLayoutPanel1);
diff --git a/varManager/FormScenes.cs b/varManager/FormScenes.cs
index 59588e8..34a3b54 100644
--- a/varManager/FormScenes.cs
+++ b/varManager/FormScenes.cs
@@ -21,9 +21,25 @@ public partial class FormScenes : Form
// private static int maxitemPerpage = 100;
private string strCategory = "scenes";
private string strOrderBy = "_";
+ private bool closingDown;
+
public FormScenes()
{
InitializeComponent();
+ // .NET 8 enumerates every virtual-list item while destroying the window
+ // (WmDestroy -> ReleaseUiaProvider -> get_Item -> RetrieveVirtualItem). With
+ // tens of thousands of items that re-entry loaded an image per item against
+ // half-disposed components — the real "freeze + memory spike on exit".
+ // Zero the virtual sizes first so teardown has nothing to enumerate.
+ this.FormClosing += (s, e) =>
+ {
+ closingDown = true;
+ listViewHide.VirtualListSize = 0;
+ listViewNormal.VirtualListSize = 0;
+ listViewFav.VirtualListSize = 0;
+ };
+ // Free the big preview bitmap deterministically when the window closes.
+ this.FormClosed += (s, e) => Comm.SwapPictureBoxImage(pictureBoxPreview, null);
}
public Form1 form1;
/*
@@ -765,7 +781,7 @@ private void listView_ItemActivate(object sender, EventArgs e)
labelPreviewVarName.Text = item.Text;
checkBoxMerge.Checked = false;
buttonLoadscene.Text = "Load " + item.SubItems[6].Text;
- pictureBoxPreview.Image = Image.FromFile(item.SubItems[3].Text);
+ Comm.SwapPictureBoxImage(pictureBoxPreview, item.SubItems[3].Text);
panelImage.Visible = true;
radioButtonPersonOrder1.Checked = true;
@@ -1051,6 +1067,7 @@ private void buttonHide_Click(object sender, EventArgs e)
private void listViewHide_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
+ if (closingDown) { e.Item = new ListViewItem(string.Empty); return; }
var curpriviewscene = listFilterCreatorSceneHide[e.ItemIndex];
RetrieveVirtualItem(e, curpriviewscene);
}
@@ -1058,13 +1075,14 @@ private void listViewHide_RetrieveVirtualItem(object sender, RetrieveVirtualItem
private void listViewNormal_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
-
- var curpriviewscene = listFilterCreatorSceneNormal[e.ItemIndex];
+ if (closingDown) { e.Item = new ListViewItem(string.Empty); return; }
+ var curpriviewscene = listFilterCreatorSceneNormal[e.ItemIndex];
RetrieveVirtualItem(e, curpriviewscene);
}
private void listViewFav_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
+ if (closingDown) { e.Item = new ListViewItem(string.Empty); return; }
var curpriviewscene = listFilterCreatorSceneFav[e.ItemIndex];
RetrieveVirtualItem(e, curpriviewscene);
}
@@ -1079,8 +1097,11 @@ private void RetrieveVirtualItem(RetrieveVirtualItemEventArgs e, varManagerDataS
}
if (!imageListScenes.Images.ContainsKey(key))
{
- imageListScenes.Images.Add(key, Image.FromFile(key));
- if (imageListScenes.Images.Count > 40) imageListScenes.Images.RemoveAt(0);
+ Comm.AddImageToList(imageListScenes, key, key);
+ // 256/192 with hysteresis: the old ">40 remove one" cap was smaller than
+ // the number of visible tiles, so visible items evicted each other and
+ // every repaint reloaded (and leaked) the whole screen of images.
+ Comm.TrimImageList(imageListScenes, 256, 192);
}
diff --git a/varManager/FormSettings.Designer.cs b/varManager/FormSettings.Designer.cs
index c72f73e..b1a5a60 100644
--- a/varManager/FormSettings.Designer.cs
+++ b/varManager/FormSettings.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormSettings
@@ -40,6 +40,7 @@ private void InitializeComponent()
this.textBoxVamPath = new System.Windows.Forms.TextBox();
this.buttonVamPath = new System.Windows.Forms.Button();
this.folderBrowserDialogVam = new System.Windows.Forms.FolderBrowserDialog();
+ this.buttonMigrate = new System.Windows.Forms.Button();
label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
@@ -140,16 +141,27 @@ private void InitializeComponent()
this.folderBrowserDialogVam.Description = global::varManager.Properties.Settings.Default.varspath;
this.folderBrowserDialogVam.SelectedPath = global::varManager.Properties.Settings.Default.varspath;
this.folderBrowserDialogVam.ShowNewFolderButton = false;
- //
+ //
+ // buttonMigrate
+ //
+ this.buttonMigrate.Location = new System.Drawing.Point(24, 470);
+ this.buttonMigrate.Name = "buttonMigrate";
+ this.buttonMigrate.Size = new System.Drawing.Size(260, 26);
+ this.buttonMigrate.TabIndex = 6;
+ this.buttonMigrate.Text = "从旧版(Access)迁移数据…";
+ this.buttonMigrate.UseVisualStyleBackColor = true;
+ this.buttonMigrate.Click += new System.EventHandler(this.buttonMigrate_Click);
+ //
// FormSettings
//
this.AcceptButton = this.buttonSave;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(800, 510);
this.ControlBox = false;
this.Controls.Add(label3);
+ this.Controls.Add(this.buttonMigrate);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.buttonVamPath);
@@ -182,5 +194,6 @@ private void InitializeComponent()
private System.Windows.Forms.TextBox textBoxVamPath;
private System.Windows.Forms.Button buttonVamPath;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialogVam;
+ private System.Windows.Forms.Button buttonMigrate;
}
}
\ No newline at end of file
diff --git a/varManager/FormSettings.cs b/varManager/FormSettings.cs
index 38c3883..9c2938e 100644
--- a/varManager/FormSettings.cs
+++ b/varManager/FormSettings.cs
@@ -64,5 +64,11 @@ private void FormSettings_FormClosing(object sender, FormClosingEventArgs e)
if (this.DialogResult == DialogResult.None)
e.Cancel = true;
}
+
+ private void buttonMigrate_Click(object sender, EventArgs e)
+ {
+ using (var f = new FormMigrate())
+ f.ShowDialog(this);
+ }
}
}
diff --git a/varManager/FormStaleVars.Designer.cs b/varManager/FormStaleVars.Designer.cs
index fbe75e8..e611c66 100644
--- a/varManager/FormStaleVars.Designer.cs
+++ b/varManager/FormStaleVars.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class FormStaleVars
{
@@ -130,7 +130,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(639, 388);
this.ControlBox = false;
diff --git a/varManager/FormSwitchAdd.Designer.cs b/varManager/FormSwitchAdd.Designer.cs
index 3f8e4b0..5fe5c61 100644
--- a/varManager/FormSwitchAdd.Designer.cs
+++ b/varManager/FormSwitchAdd.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormSwitchAdd
@@ -66,7 +66,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(272, 113);
this.ControlBox = false;
diff --git a/varManager/FormSwitchRename.Designer.cs b/varManager/FormSwitchRename.Designer.cs
index da8662c..44120f0 100644
--- a/varManager/FormSwitchRename.Designer.cs
+++ b/varManager/FormSwitchRename.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormSwitchRename
@@ -87,7 +87,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(277, 150);
this.ControlBox = false;
diff --git a/varManager/FormUninstallVars.Designer.cs b/varManager/FormUninstallVars.Designer.cs
index 6ba18e6..b303398 100644
--- a/varManager/FormUninstallVars.Designer.cs
+++ b/varManager/FormUninstallVars.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormUninstallVars
@@ -560,7 +560,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(1185, 546);
this.ControlBox = false;
diff --git a/varManager/FormUninstallVars.cs b/varManager/FormUninstallVars.cs
index e1fbeaa..7dd7f83 100644
--- a/varManager/FormUninstallVars.cs
+++ b/varManager/FormUninstallVars.cs
@@ -170,7 +170,7 @@ private void listViewPreviewPics_Click(object sender, EventArgs e)
if (item != null)
{
labelPreviewVarName.Text = item.SubItems[1].Text;
- pictureBoxPreview.Image = Image.FromFile(item.SubItems[2].Text);
+ Comm.SwapPictureBoxImage(pictureBoxPreview, item.SubItems[2].Text);
tableLayoutPanelPreview.Dock = DockStyle.Fill;
tableLayoutPanelPreview.Visible = true;
@@ -197,7 +197,7 @@ public void PreviewPics(string varname, string picpath)
}
else
{
- imageListPreviewPics.Images.Add(Image.FromFile(picpath));
+ Comm.AddImageToList(imageListPreviewPics, null, picpath);
var item = listViewPreviewPics.Items.Add(Path.GetFileNameWithoutExtension(picpath), imageListPreviewPics.Images.Count - 1);
item.SubItems.Add(varname);
item.SubItems.Add(picpath);
diff --git a/varManager/FormVarDetail.Designer.cs b/varManager/FormVarDetail.Designer.cs
index 30c7716..811434e 100644
--- a/varManager/FormVarDetail.Designer.cs
+++ b/varManager/FormVarDetail.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class FormVarDetail
{
@@ -242,7 +242,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1026, 657);
this.ControlBox = false;
this.Controls.Add(this.buttonOK);
diff --git a/varManager/FormVarDetail.cs b/varManager/FormVarDetail.cs
index 1720870..3039e85 100644
--- a/varManager/FormVarDetail.cs
+++ b/varManager/FormVarDetail.cs
@@ -94,7 +94,7 @@ private void dataGridViewDependency_CellContentClick(object sender, DataGridView
if (dependVar == "missing")
{
string varname = dependName.Replace(".latest", ".1");
- System.Diagnostics.Process.Start("https://www.google.com/search?q=" + varname + " var");
+ Comm.OpenShell("https://www.google.com/search?q=" + varname + " var");
}
else
{
diff --git a/varManager/FormVarsMove.Designer.cs b/varManager/FormVarsMove.Designer.cs
index c234037..2953abe 100644
--- a/varManager/FormVarsMove.Designer.cs
+++ b/varManager/FormVarsMove.Designer.cs
@@ -1,4 +1,4 @@
-
+
namespace varManager
{
partial class FormVarsMove
@@ -145,7 +145,7 @@ private void InitializeComponent()
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonCancle;
this.ClientSize = new System.Drawing.Size(824, 468);
this.ControlBox = false;
diff --git a/varManager/HubItem.Designer.cs b/varManager/HubItem.Designer.cs
index 975b0e9..8962c22 100644
--- a/varManager/HubItem.Designer.cs
+++ b/varManager/HubItem.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class HubItem
{
@@ -250,7 +250,7 @@ private void InitializeComponent()
// HubItem
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.Controls.Add(this.picRating5);
this.Controls.Add(this.picRating4);
diff --git a/varManager/HubItem.cs b/varManager/HubItem.cs
index 9c2b977..34f1ed3 100644
--- a/varManager/HubItem.cs
+++ b/varManager/HubItem.cs
@@ -117,7 +117,7 @@ private void buttonInRepository_Click(object sender, EventArgs e)
if (buttonInRepository.Text.StartsWith("Go To "))
{
if (!string.IsNullOrEmpty(download_url))
- System.Diagnostics.Process.Start($"{download_url}");
+ Comm.OpenShell($"{download_url}");
}
}
void RaiseGenLinkListFilterEvent(Dictionary varDownloadUrl)
@@ -222,7 +222,7 @@ public void RefreshItem()
private void pictureBoxImage_Click(object sender, EventArgs e)
{
- System.Diagnostics.Process.Start($"https://hub.virtamate.com/resources/{resource_id}/");
+ Comm.OpenShell($"https://hub.virtamate.com/resources/{resource_id}/");
}
void RaiseClickFilterEvent(string filterType,string payType,string category,string creator)
{
diff --git a/varManager/MdbToSqliteMigrator.cs b/varManager/MdbToSqliteMigrator.cs
new file mode 100644
index 0000000..d758ff2
--- /dev/null
+++ b/varManager/MdbToSqliteMigrator.cs
@@ -0,0 +1,151 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.OleDb;
+using System.Data.SQLite;
+using System.IO;
+
+namespace varManager
+{
+ /// Per-table outcome of a migration run.
+ public sealed class TableMigrateResult
+ {
+ public string Table;
+ public int Read;
+ public int Inserted;
+ public string Error;
+ }
+
+ /// Aggregate result of a migration run.
+ public sealed class MigrateResult
+ {
+ public readonly List Tables = new List();
+ public int TotalInserted;
+ public bool HasErrors
+ {
+ get { return Tables.Exists(t => t.Error != null); }
+ }
+ }
+
+ ///
+ /// Imports the five persistent tables from a legacy Access varManager.mdb into a
+ /// SQLite database. Reading the .mdb requires the Microsoft ACE OLEDB provider.
+ ///
+ /// Original ID values are preserved (explicit insert into AUTOINCREMENT columns) so any
+ /// references stay consistent. The only user-authored state (hide/favourite marks) lives
+ /// in files under the VaM folder, not in the DB, so it is unaffected by migration.
+ ///
+ public static class MdbToSqliteMigrator
+ {
+ // Order: parents before children (no FK enforcement, but keeps things tidy).
+ private static readonly string[] Tables = { "vars", "installStatus", "scenes", "dependencies", "savedepens" };
+
+ /// Simple importer used on first run (fresh DB, no clearing, no progress).
+ public static int Migrate(string mdbPath, string sqliteConnectionString)
+ {
+ return MigrateFull(mdbPath, sqliteConnectionString, clearFirst: false, progress: null).TotalInserted;
+ }
+
+ ///
+ /// Full importer for the migration tool: ensures the target schema exists, optionally
+ /// clears the target tables (full overwrite), and reports progress per table.
+ ///
+ public static MigrateResult MigrateFull(string mdbPath, string sqliteConnectionString,
+ bool clearFirst, Action progress)
+ {
+ if (string.IsNullOrWhiteSpace(mdbPath) || !File.Exists(mdbPath))
+ throw new FileNotFoundException("找不到旧数据库文件: " + mdbPath);
+
+ Report(progress, "确保目标库结构…");
+ Db.EnsureSchema(sqliteConnectionString);
+
+ var result = new MigrateResult();
+ string oleConnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + mdbPath + ";";
+
+ Report(progress, "打开旧数据库(Access)…");
+ using (var ole = new OleDbConnection(oleConnStr))
+ {
+ ole.Open();
+ using (var sq = new SQLiteConnection(sqliteConnectionString))
+ {
+ sq.Open();
+ // Bulk-load speedups (safe: a fresh import; re-run on failure).
+ using (var pragma = new SQLiteCommand("PRAGMA synchronous=OFF; PRAGMA journal_mode=MEMORY; PRAGMA temp_store=MEMORY;", sq))
+ pragma.ExecuteNonQuery();
+
+ foreach (var table in Tables)
+ {
+ var tr = new TableMigrateResult { Table = table };
+ try
+ {
+ if (clearFirst)
+ {
+ Report(progress, "清空目标表 " + table + " …");
+ using (var del = new SQLiteCommand("DELETE FROM \"" + table + "\"", sq))
+ del.ExecuteNonQuery();
+ }
+
+ Report(progress, "读取 " + table + " …");
+ var dt = new DataTable();
+ using (var da = new OleDbDataAdapter("SELECT * FROM [" + table + "]", ole))
+ da.Fill(dt);
+ tr.Read = dt.Rows.Count;
+
+ tr.Inserted = InsertRows(sq, table, dt, progress);
+ }
+ catch (Exception ex)
+ {
+ tr.Error = ex.Message;
+ Report(progress, " ! " + table + " 失败: " + ex.Message);
+ }
+ result.Tables.Add(tr);
+ result.TotalInserted += tr.Inserted;
+ Report(progress, string.Format(" {0}: 读取 {1}, 写入 {2}{3}",
+ table, tr.Read, tr.Inserted, tr.Error != null ? " (错误)" : ""));
+ }
+ }
+ }
+
+ Report(progress, "完成,共写入 " + result.TotalInserted + " 行。");
+ return result;
+ }
+
+ private static int InsertRows(SQLiteConnection sq, string table, DataTable dt, Action progress)
+ {
+ if (dt.Rows.Count == 0) return 0;
+
+ int n = dt.Columns.Count;
+ var cols = new string[n];
+ for (int i = 0; i < n; i++) cols[i] = dt.Columns[i].ColumnName;
+ string colList = string.Join(", ", Array.ConvertAll(cols, c => "\"" + c + "\""));
+ string placeholders = string.Join(", ", Array.ConvertAll(cols, _ => "?"));
+ string insertSql = "INSERT INTO \"" + table + "\" (" + colList + ") VALUES (" + placeholders + ")";
+
+ int count = 0;
+ int total = dt.Rows.Count;
+ using (var tx = sq.BeginTransaction())
+ using (var cmd = new SQLiteCommand(insertSql, sq, tx))
+ {
+ for (int i = 0; i < n; i++) cmd.Parameters.Add(new SQLiteParameter());
+ cmd.Prepare();
+
+ int done = 0;
+ foreach (DataRow row in dt.Rows)
+ {
+ for (int c = 0; c < n; c++)
+ cmd.Parameters[c].Value = row[c] ?? DBNull.Value;
+ count += cmd.ExecuteNonQuery();
+ if ((++done % 25000) == 0)
+ Report(progress, " " + table + ": " + done + "/" + total + " …");
+ }
+ tx.Commit();
+ }
+ return count;
+ }
+
+ private static void Report(Action progress, string message)
+ {
+ if (progress != null) progress(message);
+ }
+ }
+}
diff --git a/varManager/PrepareSaves.Designer.cs b/varManager/PrepareSaves.Designer.cs
index cd6e4c2..c636e9a 100644
--- a/varManager/PrepareSaves.Designer.cs
+++ b/varManager/PrepareSaves.Designer.cs
@@ -1,4 +1,4 @@
-namespace varManager
+namespace varManager
{
partial class PrepareSaves
{
@@ -175,7 +175,7 @@ private void InitializeComponent()
// PrepareSaves
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.buttonExit;
this.ClientSize = new System.Drawing.Size(1160, 732);
this.ControlBox = false;
diff --git a/varManager/Program.cs b/varManager/Program.cs
index 87c6545..288a11a 100644
--- a/varManager/Program.cs
+++ b/varManager/Program.cs
@@ -9,10 +9,33 @@ static class Program
/// 应用程序的主入口点。
///
[STAThread]
- static void Main()
+ static void Main(string[] args)
{
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
+ // Match the original .NET Framework app, which declared no DPI awareness
+ // (Windows bitmap-scales it). .NET 8 WinForms is DPI-aware by default and would
+ // re-run AutoScaleMode.Font scaling, which shifts/clips the fixed-size controls
+ // (e.g. the 70x42 bottom buttons designed for two-line Cambria 9 text).
+ // DPI mode (DpiUnaware) + visual styles + GDI text rendering are declared via the
+ // csproj Application* properties and applied by this generated initializer, which
+ // reproduces the original layout exactly across every form.
+ ApplicationConfiguration.Initialize();
+ try
+ {
+ Db.Initialize();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("数据库初始化失败:\n" + ex.Message +
+ "\n\n数据目录: " + (Db.DataDirectory ?? "(未确定)"),
+ "varManager", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ if (args != null && args.Length > 0 &&
+ string.Equals(args[0], "--migrate", StringComparison.OrdinalIgnoreCase))
+ {
+ Application.Run(new FormMigrate());
+ return;
+ }
Application.Run(new Form1());
}
}
diff --git a/varManager/varManager.csproj b/varManager/varManager.csproj
index 73fb6cf..c4f31de 100644
--- a/varManager/varManager.csproj
+++ b/varManager/varManager.csproj
@@ -1,315 +1,62 @@
-
-
-
+
+
- Debug
- AnyCPU
- {EA2A1B27-CA81-4DBF-8E10-97A0243B6184}WinExe
+ net8.0-windows
+ truevarManagervarManager
- v4.8
- 512
- true
- true
-
-
-
- false
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 2
- 1.0.0.%2a
- false
- true
- Relative
-
-
+ false
+ disable
+ disablex64
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- false
+ AnyCPU;x64true
-
-
- x64
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- false
- false
- On
-
-
- VarManager.ico
-
- app.manifest
+ true
+
+ DpiUnaware
+ true
+ false
+
+
-
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ PreserveNewest
-
- Form
-
-
- Form1.cs
-
-
- Form
-
-
- FormAnalysis.cs
-
-
- Form
-
-
- FormHub.cs
-
-
- Form
-
-
- FormMissingVars.cs
-
-
- Form
-
-
- FormScenes.cs
-
-
- Form
-
-
- FormSettings.cs
-
-
- Form
-
-
- FormStaleVars.cs
-
-
- Form
-
-
- FormSwitchRename.cs
-
-
- Form
-
-
- FormSwitchAdd.cs
-
-
- Form
-
-
- FormUninstallVars.cs
-
-
- Form
-
-
- FormVarDetail.cs
-
-
- Form
-
-
- FormVarsMove.cs
-
-
- UserControl
-
-
- HubItem.cs
-
-
- Form
-
-
- PrepareSaves.cs
-
-
-
-
-
-
-
-
-
-
-
-
- Component
-
-
- varManagerDataSet.xsd
-
-
- True
- True
- varManagerDataSet.xsd
-
-
- Form1.cs
-
-
- FormAnalysis.cs
-
-
- FormHub.cs
-
-
- FormMissingVars.cs
-
-
- FormScenes.cs
-
-
- FormSettings.cs
-
-
- FormStaleVars.cs
-
-
- FormSwitchRename.cs
-
-
- FormSwitchAdd.cs
-
-
- FormUninstallVars.cs
-
-
- FormVarDetail.cs
-
-
- FormVarsMove.cs
-
-
- HubItem.cs
-
-
- PrepareSaves.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
- varManagerDataSet.xsd
-
-
- Designer
- MSDataSetGenerator
- varManagerDataSet.Designer.cs
-
-
- varManagerDataSet.xsd
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4.8 %28x86 和 x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1
- false
-
+
+ PreserveNewest
+
+
+
-
-
-
-
-
-
-
-
- Always
-
-
- PreserveNewest
+
+
+
+
+ schema.sql
+
+
+
-
- 1.3.3
-
+
+
+
+
+
-
- {4b9be5fd-303e-4270-9c4d-fa3bde6c34eb}
- DgvFilterPopup
-
-
- {c7e21f05-c166-4dcc-8429-ec8a4c1a67b6}
- DragNDrop
-
+
+
-
-
\ No newline at end of file
+
+
diff --git a/varManager/varManagerDataSet.Designer.cs b/varManager/varManagerDataSet.Designer.cs
index 5328cac..d05f484 100644
--- a/varManager/varManagerDataSet.Designer.cs
+++ b/varManager/varManagerDataSet.Designer.cs
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
@@ -6454,3634 +6454,3 @@ public HideFavRow Row {
}
}
}
-namespace varManager.varManagerDataSetTableAdapters {
-
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class dependenciesTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public dependenciesTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "dependencies";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("dependency", "dependency");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = "DELETE FROM `dependencies` WHERE ((`ID` = ?) AND ((? = 1 AND `varName` IS NULL) O" +
- "R (`varName` = ?)) AND ((? = 1 AND `dependency` IS NULL) OR (`dependency` = ?)))" +
- "";
- this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_dependency", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO `dependencies` (`varName`, `dependency`) VALUES (?, ?)";
- this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = "UPDATE `dependencies` SET `varName` = ?, `dependency` = ? WHERE ((`ID` = ?) AND (" +
- "(? = 1 AND `varName` IS NULL) OR (`varName` = ?)) AND ((? = 1 AND `dependency` I" +
- "S NULL) OR (`dependency` = ?)))";
- this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_dependency", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, varName, dependency FROM dependencies";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.dependenciesDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.dependenciesDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.dependenciesDataTable dataTable = new varManagerDataSet.dependenciesDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet.dependenciesDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet dataSet) {
- return this.Adapter.Update(dataSet, "dependencies");
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow dataRow) {
- return this.Adapter.Update(new global::System.Data.DataRow[] {
- dataRow});
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, string Original_varName, string Original_dependency) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_varName));
- }
- if ((Original_dependency == null)) {
- throw new global::System.ArgumentNullException("Original_dependency");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string varName, string dependency) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.InsertCommand.Parameters[1].Value = ((string)(dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(string varName, string dependency, int Original_ID, string Original_varName, string Original_dependency) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(dependency));
- }
- this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(Original_ID));
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(Original_varName));
- }
- if ((Original_dependency == null)) {
- throw new global::System.ArgumentNullException("Original_dependency");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class installStatusTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public installStatusTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "installStatus";
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("Installed", "Installed");
- tableMapping.ColumnMappings.Add("Disabled", "Disabled");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = "DELETE FROM `installStatus` WHERE ((`varName` = ?) AND ((? = 1 AND `Installed` IS" +
- " NULL) OR (`Installed` = ?)) AND ((? = 1 AND `Disabled` IS NULL) OR (`Disabled` " +
- "= ?)))";
- this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Installed", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Installed", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Disabled", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Disabled", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO `installStatus` (`varName`, `Installed`, `Disabled`) VALUES (?, ?, ?)" +
- "";
- this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Installed", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Disabled", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = "UPDATE `installStatus` SET `varName` = ?, `Installed` = ?, `Disabled` = ? WHERE (" +
- "(`varName` = ?) AND ((? = 1 AND `Installed` IS NULL) OR (`Installed` = ?)) AND (" +
- "(? = 1 AND `Disabled` IS NULL) OR (`Disabled` = ?)))";
- this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Installed", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Disabled", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Installed", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Installed", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Installed", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_Disabled", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_Disabled", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "Disabled", global::System.Data.DataRowVersion.Original, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[2];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT varName, Installed, Disabled FROM installStatus";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- this._commandCollection[1] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[1].Connection = this.Connection;
- this._commandCollection[1].CommandText = "DELETE * FROM `installStatus`";
- this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.installStatusDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.installStatusDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.installStatusDataTable dataTable = new varManagerDataSet.installStatusDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet.installStatusDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet dataSet) {
- return this.Adapter.Update(dataSet, "installStatus");
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow dataRow) {
- return this.Adapter.Update(new global::System.Data.DataRow[] {
- dataRow});
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(string Original_varName, bool Original_Installed, bool Original_Disabled) {
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_varName));
- }
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((bool)(Original_Installed));
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((bool)(Original_Disabled));
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string varName, bool Installed, bool Disabled) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(varName));
- }
- this.Adapter.InsertCommand.Parameters[1].Value = ((bool)(Installed));
- this.Adapter.InsertCommand.Parameters[2].Value = ((bool)(Disabled));
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(string varName, bool Installed, bool Disabled, string Original_varName, bool Original_Installed, bool Original_Disabled) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(varName));
- }
- this.Adapter.UpdateCommand.Parameters[1].Value = ((bool)(Installed));
- this.Adapter.UpdateCommand.Parameters[2].Value = ((bool)(Disabled));
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Original_varName));
- }
- this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[5].Value = ((bool)(Original_Installed));
- this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[7].Value = ((bool)(Original_Disabled));
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(bool Installed, bool Disabled, string Original_varName, bool Original_Installed, bool Original_Disabled) {
- return this.Update(Original_varName, Installed, Disabled, Original_varName, Original_Installed, Original_Disabled);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, false)]
- public virtual int DeleteAll() {
- global::System.Data.OleDb.OleDbCommand command = this.CommandCollection[1];
- global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
- if (((command.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- command.Connection.Open();
- }
- int returnValue;
- try {
- returnValue = command.ExecuteNonQuery();
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- command.Connection.Close();
- }
- }
- return returnValue;
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class savedepensTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public savedepensTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "savedepens";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("savepath", "savepath");
- tableMapping.ColumnMappings.Add("modidate", "modidate");
- tableMapping.ColumnMappings.Add("dependency", "dependency");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = "DELETE FROM `savedepens` WHERE ((`ID` = ?) AND ((? = 1 AND `savepath` IS NULL) OR" +
- " (`savepath` = ?)) AND ((? = 1 AND `modidate` IS NULL) OR (`modidate` = ?)) AND " +
- "((? = 1 AND `dependency` IS NULL) OR (`dependency` = ?)))";
- this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_savepath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_savepath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_modidate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_modidate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_dependency", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO `savedepens` (`savepath`, `modidate`, `dependency`) VALUES (?, ?, ?)";
- this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("savepath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("modidate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE `savedepens` SET `savepath` = ?, `modidate` = ?, `dependency` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `savepath` IS NULL) OR (`savepath` = ?)) AND ((? = 1 AND `modidate` IS NULL) OR (`modidate` = ?)) AND ((? = 1 AND `dependency` IS NULL) OR (`dependency` = ?)))";
- this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("savepath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("modidate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_savepath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_savepath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "savepath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_modidate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_modidate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "modidate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_dependency", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_dependency", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Original, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[2];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, savepath, modidate, dependency FROM savedepens";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- this._commandCollection[1] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[1].Connection = this.Connection;
- this._commandCollection[1].CommandText = "SELECT ID, savepath, modidate, dependency\r\nFROM savedepens whe\r\nWHERE (de" +
- "pendency = ?)";
- this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
- this._commandCollection[1].Parameters.Add(new global::System.Data.OleDb.OleDbParameter("dependency", global::System.Data.OleDb.OleDbType.WChar, 255, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "dependency", global::System.Data.DataRowVersion.Current, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.savedepensDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.savedepensDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.savedepensDataTable dataTable = new varManagerDataSet.savedepensDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
- public virtual int FillByDepens(varManagerDataSet.savedepensDataTable dataTable, string dependency) {
- this.Adapter.SelectCommand = this.CommandCollection[1];
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.SelectCommand.Parameters[0].Value = ((string)(dependency));
- }
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
- public virtual varManagerDataSet.savedepensDataTable GetDataByDepens(string dependency) {
- this.Adapter.SelectCommand = this.CommandCollection[1];
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.SelectCommand.Parameters[0].Value = ((string)(dependency));
- }
- varManagerDataSet.savedepensDataTable dataTable = new varManagerDataSet.savedepensDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet.savedepensDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet dataSet) {
- return this.Adapter.Update(dataSet, "savedepens");
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow dataRow) {
- return this.Adapter.Update(new global::System.Data.DataRow[] {
- dataRow});
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, string Original_savepath, System.DateTime Original_modidate, string Original_dependency) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_savepath == null)) {
- throw new global::System.ArgumentNullException("Original_savepath");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_savepath));
- }
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((System.DateTime)(Original_modidate));
- if ((Original_dependency == null)) {
- throw new global::System.ArgumentNullException("Original_dependency");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string savepath, System.DateTime modidate, string dependency) {
- if ((savepath == null)) {
- throw new global::System.ArgumentNullException("savepath");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(savepath));
- }
- this.Adapter.InsertCommand.Parameters[1].Value = ((System.DateTime)(modidate));
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.InsertCommand.Parameters[2].Value = ((string)(dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(string savepath, System.DateTime modidate, string dependency, int Original_ID, string Original_savepath, System.DateTime Original_modidate, string Original_dependency) {
- if ((savepath == null)) {
- throw new global::System.ArgumentNullException("savepath");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(savepath));
- }
- this.Adapter.UpdateCommand.Parameters[1].Value = ((System.DateTime)(modidate));
- if ((dependency == null)) {
- throw new global::System.ArgumentNullException("dependency");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(dependency));
- }
- this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_ID));
- if ((Original_savepath == null)) {
- throw new global::System.ArgumentNullException("Original_savepath");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_savepath));
- }
- this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[7].Value = ((System.DateTime)(Original_modidate));
- if ((Original_dependency == null)) {
- throw new global::System.ArgumentNullException("Original_dependency");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_dependency));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class installedScenesTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public installedScenesTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "installedScenes";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("atomType", "atomType");
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("scenePath", "scenePath");
- tableMapping.ColumnMappings.Add("previewPic", "previewPic");
- tableMapping.ColumnMappings.Add("metaDate", "metaDate");
- tableMapping.ColumnMappings.Add("varDate", "varDate");
- tableMapping.ColumnMappings.Add("Installed", "Installed");
- this._adapter.TableMappings.Add(tableMapping);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, atomType, varName, scenePath, previewPic, metaDate, varDate, Installed" +
- " FROM installedScenes";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.installedScenesDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.installedScenesDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.installedScenesDataTable dataTable = new varManagerDataSet.installedScenesDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class varsTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public varsTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "vars";
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("varPath", "varPath");
- tableMapping.ColumnMappings.Add("creatorName", "creatorName");
- tableMapping.ColumnMappings.Add("packageName", "packageName");
- tableMapping.ColumnMappings.Add("version", "version");
- tableMapping.ColumnMappings.Add("metaDate", "metaDate");
- tableMapping.ColumnMappings.Add("varDate", "varDate");
- tableMapping.ColumnMappings.Add("filesize", "filesize");
- tableMapping.ColumnMappings.Add("scenes", "scenes");
- tableMapping.ColumnMappings.Add("looks", "looks");
- tableMapping.ColumnMappings.Add("clothing", "clothing");
- tableMapping.ColumnMappings.Add("hairstyle", "hairstyle");
- tableMapping.ColumnMappings.Add("plugins", "plugins");
- tableMapping.ColumnMappings.Add("assets", "assets");
- tableMapping.ColumnMappings.Add("morphs", "morphs");
- tableMapping.ColumnMappings.Add("pose", "pose");
- tableMapping.ColumnMappings.Add("skin", "skin");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = @"DELETE FROM `vars` WHERE ((`varName` = ?) AND ((? = 1 AND `varPath` IS NULL) OR (`varPath` = ?)) AND ((? = 1 AND `creatorName` IS NULL) OR (`creatorName` = ?)) AND ((? = 1 AND `packageName` IS NULL) OR (`packageName` = ?)) AND ((? = 1 AND `version` IS NULL) OR (`version` = ?)) AND ((? = 1 AND `metaDate` IS NULL) OR (`metaDate` = ?)) AND ((? = 1 AND `varDate` IS NULL) OR (`varDate` = ?)) AND ((? = 1 AND `filesize` IS NULL) OR (`filesize` = ?)) AND ((? = 1 AND `scenes` IS NULL) OR (`scenes` = ?)) AND ((? = 1 AND `looks` IS NULL) OR (`looks` = ?)) AND ((? = 1 AND `clothing` IS NULL) OR (`clothing` = ?)) AND ((? = 1 AND `hairstyle` IS NULL) OR (`hairstyle` = ?)) AND ((? = 1 AND `plugins` IS NULL) OR (`plugins` = ?)) AND ((? = 1 AND `assets` IS NULL) OR (`assets` = ?)) AND ((? = 1 AND `morphs` IS NULL) OR (`morphs` = ?)) AND ((? = 1 AND `pose` IS NULL) OR (`pose` = ?)) AND ((? = 1 AND `skin` IS NULL) OR (`skin` = ?)))";
- this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varPath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varPath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_creatorName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_creatorName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_packageName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_packageName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_metaDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_metaDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_filesize", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_filesize", global::System.Data.OleDb.OleDbType.Double, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = @"INSERT INTO `vars` (`varName`, `varPath`, `creatorName`, `packageName`, `version`, `metaDate`, `varDate`, `filesize`, `scenes`, `looks`, `clothing`, `hairstyle`, `plugins`, `assets`, `morphs`, `pose`, `skin`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
- this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varPath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("creatorName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("packageName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("metaDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("filesize", global::System.Data.OleDb.OleDbType.Double, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE `vars` SET `varName` = ?, `varPath` = ?, `creatorName` = ?, `packageName` = ?, `version` = ?, `metaDate` = ?, `varDate` = ?, `filesize` = ?, `scenes` = ?, `looks` = ?, `clothing` = ?, `hairstyle` = ?, `plugins` = ?, `assets` = ?, `morphs` = ?, `pose` = ?, `skin` = ? WHERE ((`varName` = ?) AND ((? = 1 AND `varPath` IS NULL) OR (`varPath` = ?)) AND ((? = 1 AND `creatorName` IS NULL) OR (`creatorName` = ?)) AND ((? = 1 AND `packageName` IS NULL) OR (`packageName` = ?)) AND ((? = 1 AND `version` IS NULL) OR (`version` = ?)) AND ((? = 1 AND `metaDate` IS NULL) OR (`metaDate` = ?)) AND ((? = 1 AND `varDate` IS NULL) OR (`varDate` = ?)) AND ((? = 1 AND `filesize` IS NULL) OR (`filesize` = ?)) AND ((? = 1 AND `scenes` IS NULL) OR (`scenes` = ?)) AND ((? = 1 AND `looks` IS NULL) OR (`looks` = ?)) AND ((? = 1 AND `clothing` IS NULL) OR (`clothing` = ?)) AND ((? = 1 AND `hairstyle` IS NULL) OR (`hairstyle` = ?)) AND ((? = 1 AND `plugins` IS NULL) OR (`plugins` = ?)) AND ((? = 1 AND `assets` IS NULL) OR (`assets` = ?)) AND ((? = 1 AND `morphs` IS NULL) OR (`morphs` = ?)) AND ((? = 1 AND `pose` IS NULL) OR (`pose` = ?)) AND ((? = 1 AND `skin` IS NULL) OR (`skin` = ?)))";
- this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varPath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("creatorName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("packageName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("metaDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("filesize", global::System.Data.OleDb.OleDbType.Double, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varPath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varPath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varPath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_creatorName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_creatorName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "creatorName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_packageName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_packageName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "packageName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_version", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "version", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_metaDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_metaDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "metaDate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varDate", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varDate", global::System.Data.OleDb.OleDbType.Date, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varDate", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_filesize", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_filesize", global::System.Data.OleDb.OleDbType.Double, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "filesize", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_scenes", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenes", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_looks", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "looks", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_clothing", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "clothing", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_hairstyle", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "hairstyle", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_plugins", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "plugins", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_assets", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "assets", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_morphs", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "morphs", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_pose", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "pose", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_skin", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "skin", global::System.Data.DataRowVersion.Original, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT varName, varPath, creatorName, packageName, version, metaDate, varDate, fi" +
- "lesize, scenes, looks, clothing, hairstyle, plugins, assets, morphs, pose, skin " +
- "FROM vars";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.varsDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.varsDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.varsDataTable dataTable = new varManagerDataSet.varsDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet.varsDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet dataSet) {
- return this.Adapter.Update(dataSet, "vars");
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow dataRow) {
- return this.Adapter.Update(new global::System.Data.DataRow[] {
- dataRow});
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(
- string Original_varName,
- string Original_varPath,
- string Original_creatorName,
- string Original_packageName,
- global::System.Nullable Original_version,
- global::System.Nullable Original_metaDate,
- global::System.Nullable Original_varDate,
- global::System.Nullable Original_filesize,
- global::System.Nullable Original_scenes,
- global::System.Nullable Original_looks,
- global::System.Nullable Original_clothing,
- global::System.Nullable Original_hairstyle,
- global::System.Nullable Original_plugins,
- global::System.Nullable Original_assets,
- global::System.Nullable Original_morphs,
- global::System.Nullable Original_pose,
- global::System.Nullable Original_skin) {
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_varName));
- }
- if ((Original_varPath == null)) {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_varPath));
- }
- if ((Original_creatorName == null)) {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_creatorName));
- }
- if ((Original_packageName == null)) {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_packageName));
- }
- if ((Original_version.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[8].Value = ((int)(Original_version.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
- }
- if ((Original_metaDate.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[10].Value = ((System.DateTime)(Original_metaDate.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
- }
- if ((Original_varDate.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[12].Value = ((System.DateTime)(Original_varDate.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[11].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[12].Value = global::System.DBNull.Value;
- }
- if ((Original_filesize.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[14].Value = ((double)(Original_filesize.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[13].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[14].Value = global::System.DBNull.Value;
- }
- if ((Original_scenes.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[16].Value = ((int)(Original_scenes.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[15].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[16].Value = global::System.DBNull.Value;
- }
- if ((Original_looks.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[18].Value = ((int)(Original_looks.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[17].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[18].Value = global::System.DBNull.Value;
- }
- if ((Original_clothing.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[20].Value = ((int)(Original_clothing.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[19].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[20].Value = global::System.DBNull.Value;
- }
- if ((Original_hairstyle.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[22].Value = ((int)(Original_hairstyle.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[21].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[22].Value = global::System.DBNull.Value;
- }
- if ((Original_plugins.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[24].Value = ((int)(Original_plugins.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[23].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[24].Value = global::System.DBNull.Value;
- }
- if ((Original_assets.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[26].Value = ((int)(Original_assets.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[25].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[26].Value = global::System.DBNull.Value;
- }
- if ((Original_morphs.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[27].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[28].Value = ((int)(Original_morphs.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[27].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[28].Value = global::System.DBNull.Value;
- }
- if ((Original_pose.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[29].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[30].Value = ((int)(Original_pose.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[29].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[30].Value = global::System.DBNull.Value;
- }
- if ((Original_skin.HasValue == true)) {
- this.Adapter.DeleteCommand.Parameters[31].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[32].Value = ((int)(Original_skin.Value));
- }
- else {
- this.Adapter.DeleteCommand.Parameters[31].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[32].Value = global::System.DBNull.Value;
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(
- string varName,
- string varPath,
- string creatorName,
- string packageName,
- global::System.Nullable version,
- global::System.Nullable metaDate,
- global::System.Nullable varDate,
- global::System.Nullable filesize,
- global::System.Nullable scenes,
- global::System.Nullable looks,
- global::System.Nullable clothing,
- global::System.Nullable hairstyle,
- global::System.Nullable plugins,
- global::System.Nullable assets,
- global::System.Nullable morphs,
- global::System.Nullable pose,
- global::System.Nullable skin) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((varPath == null)) {
- this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[1].Value = ((string)(varPath));
- }
- if ((creatorName == null)) {
- this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[2].Value = ((string)(creatorName));
- }
- if ((packageName == null)) {
- this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[3].Value = ((string)(packageName));
- }
- if ((version.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[4].Value = ((int)(version.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- if ((metaDate.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(metaDate.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value;
- }
- if ((varDate.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[6].Value = ((System.DateTime)(varDate.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[6].Value = global::System.DBNull.Value;
- }
- if ((filesize.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[7].Value = ((double)(filesize.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[7].Value = global::System.DBNull.Value;
- }
- if ((scenes.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[8].Value = ((int)(scenes.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[8].Value = global::System.DBNull.Value;
- }
- if ((looks.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[9].Value = ((int)(looks.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[9].Value = global::System.DBNull.Value;
- }
- if ((clothing.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[10].Value = ((int)(clothing.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[10].Value = global::System.DBNull.Value;
- }
- if ((hairstyle.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[11].Value = ((int)(hairstyle.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[11].Value = global::System.DBNull.Value;
- }
- if ((plugins.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[12].Value = ((int)(plugins.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[12].Value = global::System.DBNull.Value;
- }
- if ((assets.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[13].Value = ((int)(assets.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[13].Value = global::System.DBNull.Value;
- }
- if ((morphs.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[14].Value = ((int)(morphs.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[14].Value = global::System.DBNull.Value;
- }
- if ((pose.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[15].Value = ((int)(pose.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[15].Value = global::System.DBNull.Value;
- }
- if ((skin.HasValue == true)) {
- this.Adapter.InsertCommand.Parameters[16].Value = ((int)(skin.Value));
- }
- else {
- this.Adapter.InsertCommand.Parameters[16].Value = global::System.DBNull.Value;
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(
- string varName,
- string varPath,
- string creatorName,
- string packageName,
- global::System.Nullable version,
- global::System.Nullable metaDate,
- global::System.Nullable varDate,
- global::System.Nullable filesize,
- global::System.Nullable scenes,
- global::System.Nullable looks,
- global::System.Nullable clothing,
- global::System.Nullable hairstyle,
- global::System.Nullable plugins,
- global::System.Nullable assets,
- global::System.Nullable morphs,
- global::System.Nullable pose,
- global::System.Nullable skin,
- string Original_varName,
- string Original_varPath,
- string Original_creatorName,
- string Original_packageName,
- global::System.Nullable Original_version,
- global::System.Nullable Original_metaDate,
- global::System.Nullable Original_varDate,
- global::System.Nullable Original_filesize,
- global::System.Nullable Original_scenes,
- global::System.Nullable Original_looks,
- global::System.Nullable Original_clothing,
- global::System.Nullable Original_hairstyle,
- global::System.Nullable Original_plugins,
- global::System.Nullable Original_assets,
- global::System.Nullable Original_morphs,
- global::System.Nullable Original_pose,
- global::System.Nullable Original_skin) {
- if ((varName == null)) {
- throw new global::System.ArgumentNullException("varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((varPath == null)) {
- this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(varPath));
- }
- if ((creatorName == null)) {
- this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(creatorName));
- }
- if ((packageName == null)) {
- this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(packageName));
- }
- if ((version.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(version.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- if ((metaDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[5].Value = ((System.DateTime)(metaDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value;
- }
- if ((varDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(varDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value;
- }
- if ((filesize.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[7].Value = ((double)(filesize.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value;
- }
- if ((scenes.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(scenes.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value;
- }
- if ((looks.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(looks.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value;
- }
- if ((clothing.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[10].Value = ((int)(clothing.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value;
- }
- if ((hairstyle.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[11].Value = ((int)(hairstyle.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[11].Value = global::System.DBNull.Value;
- }
- if ((plugins.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((int)(plugins.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value;
- }
- if ((assets.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[13].Value = ((int)(assets.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[13].Value = global::System.DBNull.Value;
- }
- if ((morphs.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[14].Value = ((int)(morphs.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[14].Value = global::System.DBNull.Value;
- }
- if ((pose.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[15].Value = ((int)(pose.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[15].Value = global::System.DBNull.Value;
- }
- if ((skin.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[16].Value = ((int)(skin.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value;
- }
- if ((Original_varName == null)) {
- throw new global::System.ArgumentNullException("Original_varName");
- }
- else {
- this.Adapter.UpdateCommand.Parameters[17].Value = ((string)(Original_varName));
- }
- if ((Original_varPath == null)) {
- this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[19].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[19].Value = ((string)(Original_varPath));
- }
- if ((Original_creatorName == null)) {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[21].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[21].Value = ((string)(Original_creatorName));
- }
- if ((Original_packageName == null)) {
- this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[23].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[23].Value = ((string)(Original_packageName));
- }
- if ((Original_version.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[25].Value = ((int)(Original_version.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[25].Value = global::System.DBNull.Value;
- }
- if ((Original_metaDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[26].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[27].Value = ((System.DateTime)(Original_metaDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[26].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[27].Value = global::System.DBNull.Value;
- }
- if ((Original_varDate.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[28].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[29].Value = ((System.DateTime)(Original_varDate.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[28].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[29].Value = global::System.DBNull.Value;
- }
- if ((Original_filesize.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[30].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[31].Value = ((double)(Original_filesize.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[30].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[31].Value = global::System.DBNull.Value;
- }
- if ((Original_scenes.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[33].Value = ((int)(Original_scenes.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[32].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[33].Value = global::System.DBNull.Value;
- }
- if ((Original_looks.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[34].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[35].Value = ((int)(Original_looks.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[34].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[35].Value = global::System.DBNull.Value;
- }
- if ((Original_clothing.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[36].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[37].Value = ((int)(Original_clothing.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[36].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[37].Value = global::System.DBNull.Value;
- }
- if ((Original_hairstyle.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[38].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[39].Value = ((int)(Original_hairstyle.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[38].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[39].Value = global::System.DBNull.Value;
- }
- if ((Original_plugins.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[40].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[41].Value = ((int)(Original_plugins.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[40].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[41].Value = global::System.DBNull.Value;
- }
- if ((Original_assets.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[42].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[43].Value = ((int)(Original_assets.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[42].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[43].Value = global::System.DBNull.Value;
- }
- if ((Original_morphs.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[44].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[45].Value = ((int)(Original_morphs.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[44].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[45].Value = global::System.DBNull.Value;
- }
- if ((Original_pose.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[46].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[47].Value = ((int)(Original_pose.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[46].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[47].Value = global::System.DBNull.Value;
- }
- if ((Original_skin.HasValue == true)) {
- this.Adapter.UpdateCommand.Parameters[48].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[49].Value = ((int)(Original_skin.Value));
- }
- else {
- this.Adapter.UpdateCommand.Parameters[48].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[49].Value = global::System.DBNull.Value;
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(
- string varPath,
- string creatorName,
- string packageName,
- global::System.Nullable version,
- global::System.Nullable metaDate,
- global::System.Nullable varDate,
- global::System.Nullable filesize,
- global::System.Nullable scenes,
- global::System.Nullable looks,
- global::System.Nullable clothing,
- global::System.Nullable hairstyle,
- global::System.Nullable plugins,
- global::System.Nullable assets,
- global::System.Nullable morphs,
- global::System.Nullable pose,
- global::System.Nullable skin,
- string Original_varName,
- string Original_varPath,
- string Original_creatorName,
- string Original_packageName,
- global::System.Nullable Original_version,
- global::System.Nullable Original_metaDate,
- global::System.Nullable Original_varDate,
- global::System.Nullable Original_filesize,
- global::System.Nullable Original_scenes,
- global::System.Nullable Original_looks,
- global::System.Nullable Original_clothing,
- global::System.Nullable Original_hairstyle,
- global::System.Nullable Original_plugins,
- global::System.Nullable Original_assets,
- global::System.Nullable Original_morphs,
- global::System.Nullable Original_pose,
- global::System.Nullable Original_skin) {
- return this.Update(Original_varName, varPath, creatorName, packageName, version, metaDate, varDate, filesize, scenes, looks, clothing, hairstyle, plugins, assets, morphs, pose, skin, Original_varName, Original_varPath, Original_creatorName, Original_packageName, Original_version, Original_metaDate, Original_varDate, Original_filesize, Original_scenes, Original_looks, Original_clothing, Original_hairstyle, Original_plugins, Original_assets, Original_morphs, Original_pose, Original_skin);
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class scenesTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public scenesTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "scenes";
- tableMapping.ColumnMappings.Add("ID", "ID");
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("atomType", "atomType");
- tableMapping.ColumnMappings.Add("isPreset", "isPreset");
- tableMapping.ColumnMappings.Add("scenePath", "scenePath");
- tableMapping.ColumnMappings.Add("previewPic", "previewPic");
- this._adapter.TableMappings.Add(tableMapping);
- this._adapter.DeleteCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.DeleteCommand.Connection = this.Connection;
- this._adapter.DeleteCommand.CommandText = @"DELETE FROM `scenes` WHERE ((`ID` = ?) AND ((? = 1 AND `varName` IS NULL) OR (`varName` = ?)) AND ((? = 1 AND `atomType` IS NULL) OR (`atomType` = ?)) AND ((? = 1 AND `isPreset` IS NULL) OR (`isPreset` = ?)) AND ((? = 1 AND `scenePath` IS NULL) OR (`scenePath` = ?)) AND ((? = 1 AND `previewPic` IS NULL) OR (`previewPic` = ?)))";
- this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_atomType", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_atomType", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_isPreset", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_isPreset", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_scenePath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_scenePath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_previewPic", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_previewPic", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.InsertCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.InsertCommand.Connection = this.Connection;
- this._adapter.InsertCommand.CommandText = "INSERT INTO `scenes` (`varName`, `atomType`, `isPreset`, `scenePath`, `previewPic" +
- "`) VALUES (?, ?, ?, ?, ?)";
- this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("atomType", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("isPreset", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("scenePath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.InsertCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("previewPic", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand = new global::System.Data.OleDb.OleDbCommand();
- this._adapter.UpdateCommand.Connection = this.Connection;
- this._adapter.UpdateCommand.CommandText = @"UPDATE `scenes` SET `varName` = ?, `atomType` = ?, `isPreset` = ?, `scenePath` = ?, `previewPic` = ? WHERE ((`ID` = ?) AND ((? = 1 AND `varName` IS NULL) OR (`varName` = ?)) AND ((? = 1 AND `atomType` IS NULL) OR (`atomType` = ?)) AND ((? = 1 AND `isPreset` IS NULL) OR (`isPreset` = ?)) AND ((? = 1 AND `scenePath` IS NULL) OR (`scenePath` = ?)) AND ((? = 1 AND `previewPic` IS NULL) OR (`previewPic` = ?)))";
- this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text;
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("atomType", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("isPreset", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("scenePath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("previewPic", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Current, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_ID", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "ID", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_varName", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_varName", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_atomType", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_atomType", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "atomType", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_isPreset", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_isPreset", global::System.Data.OleDb.OleDbType.Boolean, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "isPreset", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_scenePath", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_scenePath", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "scenePath", global::System.Data.DataRowVersion.Original, false, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("IsNull_previewPic", global::System.Data.OleDb.OleDbType.Integer, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Original, true, null));
- this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.OleDb.OleDbParameter("Original_previewPic", global::System.Data.OleDb.OleDbType.VarWChar, 0, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "previewPic", global::System.Data.DataRowVersion.Original, false, null));
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[3];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT ID, varName, atomType, isPreset, scenePath, previewPic FROM scenes";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- this._commandCollection[1] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[1].Connection = this.Connection;
- this._commandCollection[1].CommandText = "SELECT ID, varName, atomType, isPreset, scenePath, previewPic\r\nFROM scenes\r" +
- "\nWHERE (varName = ?)";
- this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
- this._commandCollection[1].Parameters.Add(new global::System.Data.OleDb.OleDbParameter("varName", global::System.Data.OleDb.OleDbType.WChar, 255, global::System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "varName", global::System.Data.DataRowVersion.Current, false, null));
- this._commandCollection[2] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[2].Connection = this.Connection;
- this._commandCollection[2].CommandText = "SELECT ID, varName, atomType, isPreset, scenePath, previewPic\r\nFROM scenes\r" +
- "\nWHERE (atomType = \'scenes\') OR\r\n (isPreset = true)";
- this._commandCollection[2].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.scenesDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.scenesDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.scenesDataTable dataTable = new varManagerDataSet.scenesDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
- public virtual int FillBy(varManagerDataSet.scenesDataTable dataTable, string varName) {
- this.Adapter.SelectCommand = this.CommandCollection[1];
- if ((varName == null)) {
- this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.SelectCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
- public virtual varManagerDataSet.scenesDataTable GetDataByVarName(string varName) {
- this.Adapter.SelectCommand = this.CommandCollection[1];
- if ((varName == null)) {
- this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.SelectCommand.Parameters[0].Value = ((string)(varName));
- }
- varManagerDataSet.scenesDataTable dataTable = new varManagerDataSet.scenesDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, false)]
- public virtual int FillByLoadable(varManagerDataSet.scenesDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[2];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
- public virtual varManagerDataSet.scenesDataTable GetByLoadable() {
- this.Adapter.SelectCommand = this.CommandCollection[2];
- varManagerDataSet.scenesDataTable dataTable = new varManagerDataSet.scenesDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet.scenesDataTable dataTable) {
- return this.Adapter.Update(dataTable);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(varManagerDataSet dataSet) {
- return this.Adapter.Update(dataSet, "scenes");
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow dataRow) {
- return this.Adapter.Update(new global::System.Data.DataRow[] {
- dataRow});
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public virtual int Update(global::System.Data.DataRow[] dataRows) {
- return this.Adapter.Update(dataRows);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)]
- public virtual int Delete(int Original_ID, string Original_varName, string Original_atomType, bool Original_isPreset, string Original_scenePath, string Original_previewPic) {
- this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ID));
- if ((Original_varName == null)) {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[2].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[1].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_varName));
- }
- if ((Original_atomType == null)) {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[3].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_atomType));
- }
- this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[6].Value = ((bool)(Original_isPreset));
- if ((Original_scenePath == null)) {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[8].Value = ((string)(Original_scenePath));
- }
- if ((Original_previewPic == null)) {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1));
- this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0));
- this.Adapter.DeleteCommand.Parameters[10].Value = ((string)(Original_previewPic));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
- if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.DeleteCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.DeleteCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]
- public virtual int Insert(string varName, string atomType, bool isPreset, string scenePath, string previewPic) {
- if ((varName == null)) {
- this.Adapter.InsertCommand.Parameters[0].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((atomType == null)) {
- this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[1].Value = ((string)(atomType));
- }
- this.Adapter.InsertCommand.Parameters[2].Value = ((bool)(isPreset));
- if ((scenePath == null)) {
- this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[3].Value = ((string)(scenePath));
- }
- if ((previewPic == null)) {
- this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.InsertCommand.Parameters[4].Value = ((string)(previewPic));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
- if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.InsertCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.InsertCommand.Connection.Close();
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)]
- public virtual int Update(string varName, string atomType, bool isPreset, string scenePath, string previewPic, int Original_ID, string Original_varName, string Original_atomType, bool Original_isPreset, string Original_scenePath, string Original_previewPic) {
- if ((varName == null)) {
- this.Adapter.UpdateCommand.Parameters[0].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(varName));
- }
- if ((atomType == null)) {
- this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(atomType));
- }
- this.Adapter.UpdateCommand.Parameters[2].Value = ((bool)(isPreset));
- if ((scenePath == null)) {
- this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(scenePath));
- }
- if ((previewPic == null)) {
- this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(previewPic));
- }
- this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_ID));
- if ((Original_varName == null)) {
- this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[6].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_varName));
- }
- if ((Original_atomType == null)) {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[8].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_atomType));
- }
- this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[11].Value = ((bool)(Original_isPreset));
- if ((Original_scenePath == null)) {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[13].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[13].Value = ((string)(Original_scenePath));
- }
- if ((Original_previewPic == null)) {
- this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(1));
- this.Adapter.UpdateCommand.Parameters[15].Value = global::System.DBNull.Value;
- }
- else {
- this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(0));
- this.Adapter.UpdateCommand.Parameters[15].Value = ((string)(Original_previewPic));
- }
- global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
- if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open)
- != global::System.Data.ConnectionState.Open)) {
- this.Adapter.UpdateCommand.Connection.Open();
- }
- try {
- int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery();
- return returnValue;
- }
- finally {
- if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
- this.Adapter.UpdateCommand.Connection.Close();
- }
- }
- }
- }
-
- ///
- ///Represents the connection and commands used to retrieve and save data.
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DataObjectAttribute(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
- ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- public partial class varsViewTableAdapter : global::System.ComponentModel.Component {
-
- private global::System.Data.OleDb.OleDbDataAdapter _adapter;
-
- private global::System.Data.OleDb.OleDbConnection _connection;
-
- private global::System.Data.OleDb.OleDbTransaction _transaction;
-
- private global::System.Data.OleDb.OleDbCommand[] _commandCollection;
-
- private bool _clearBeforeFill;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public varsViewTableAdapter() {
- this.ClearBeforeFill = true;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected internal global::System.Data.OleDb.OleDbDataAdapter Adapter {
- get {
- if ((this._adapter == null)) {
- this.InitAdapter();
- }
- return this._adapter;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbConnection Connection {
- get {
- if ((this._connection == null)) {
- this.InitConnection();
- }
- return this._connection;
- }
- set {
- this._connection = value;
- if ((this.Adapter.InsertCommand != null)) {
- this.Adapter.InsertCommand.Connection = value;
- }
- if ((this.Adapter.DeleteCommand != null)) {
- this.Adapter.DeleteCommand.Connection = value;
- }
- if ((this.Adapter.UpdateCommand != null)) {
- this.Adapter.UpdateCommand.Connection = value;
- }
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- if ((this.CommandCollection[i] != null)) {
- ((global::System.Data.OleDb.OleDbCommand)(this.CommandCollection[i])).Connection = value;
- }
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- internal global::System.Data.OleDb.OleDbTransaction Transaction {
- get {
- return this._transaction;
- }
- set {
- this._transaction = value;
- for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
- this.CommandCollection[i].Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.DeleteCommand != null))) {
- this.Adapter.DeleteCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.InsertCommand != null))) {
- this.Adapter.InsertCommand.Transaction = this._transaction;
- }
- if (((this.Adapter != null)
- && (this.Adapter.UpdateCommand != null))) {
- this.Adapter.UpdateCommand.Transaction = this._transaction;
- }
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- protected global::System.Data.OleDb.OleDbCommand[] CommandCollection {
- get {
- if ((this._commandCollection == null)) {
- this.InitCommandCollection();
- }
- return this._commandCollection;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool ClearBeforeFill {
- get {
- return this._clearBeforeFill;
- }
- set {
- this._clearBeforeFill = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitAdapter() {
- this._adapter = new global::System.Data.OleDb.OleDbDataAdapter();
- global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
- tableMapping.SourceTable = "Table";
- tableMapping.DataSetTable = "varsView";
- tableMapping.ColumnMappings.Add("varName", "varName");
- tableMapping.ColumnMappings.Add("varPath", "varPath");
- tableMapping.ColumnMappings.Add("creatorName", "creatorName");
- tableMapping.ColumnMappings.Add("packageName", "packageName");
- tableMapping.ColumnMappings.Add("version", "version");
- tableMapping.ColumnMappings.Add("metaDate", "metaDate");
- tableMapping.ColumnMappings.Add("varDate", "varDate");
- tableMapping.ColumnMappings.Add("filesize", "filesize");
- tableMapping.ColumnMappings.Add("scenes", "scenes");
- tableMapping.ColumnMappings.Add("looks", "looks");
- tableMapping.ColumnMappings.Add("clothing", "clothing");
- tableMapping.ColumnMappings.Add("hairstyle", "hairstyle");
- tableMapping.ColumnMappings.Add("plugins", "plugins");
- tableMapping.ColumnMappings.Add("assets", "assets");
- tableMapping.ColumnMappings.Add("morphs", "morphs");
- tableMapping.ColumnMappings.Add("pose", "pose");
- tableMapping.ColumnMappings.Add("skin", "skin");
- tableMapping.ColumnMappings.Add("Installed", "Installed");
- tableMapping.ColumnMappings.Add("Disabled", "Disabled");
- tableMapping.ColumnMappings.Add("fsize", "fsize");
- this._adapter.TableMappings.Add(tableMapping);
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitConnection() {
- this._connection = new global::System.Data.OleDb.OleDbConnection();
- this._connection.ConnectionString = global::varManager.Properties.Settings.Default.varManagerConnectionString;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private void InitCommandCollection() {
- this._commandCollection = new global::System.Data.OleDb.OleDbCommand[1];
- this._commandCollection[0] = new global::System.Data.OleDb.OleDbCommand();
- this._commandCollection[0].Connection = this.Connection;
- this._commandCollection[0].CommandText = "SELECT varName, varPath, creatorName, packageName, version, metaDate, varDate, fi" +
- "lesize, scenes, looks, clothing, hairstyle, plugins, assets, morphs, pose, skin," +
- " Installed, Disabled, fsize FROM varsView";
- this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
- public virtual int Fill(varManagerDataSet.varsViewDataTable dataTable) {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- if ((this.ClearBeforeFill == true)) {
- dataTable.Clear();
- }
- int returnValue = this.Adapter.Fill(dataTable);
- return returnValue;
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
- [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
- public virtual varManagerDataSet.varsViewDataTable GetData() {
- this.Adapter.SelectCommand = this.CommandCollection[0];
- varManagerDataSet.varsViewDataTable dataTable = new varManagerDataSet.varsViewDataTable();
- this.Adapter.Fill(dataTable);
- return dataTable;
- }
- }
-
- ///
- ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios
- ///
- [global::System.ComponentModel.DesignerCategoryAttribute("code")]
- [global::System.ComponentModel.ToolboxItem(true)]
- [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" +
- "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
- [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")]
- public partial class TableAdapterManager : global::System.ComponentModel.Component {
-
- private UpdateOrderOption _updateOrder;
-
- private dependenciesTableAdapter _dependenciesTableAdapter;
-
- private installStatusTableAdapter _installStatusTableAdapter;
-
- private savedepensTableAdapter _savedepensTableAdapter;
-
- private varsTableAdapter _varsTableAdapter;
-
- private scenesTableAdapter _scenesTableAdapter;
-
- private bool _backupDataSetBeforeUpdate;
-
- private global::System.Data.IDbConnection _connection;
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public UpdateOrderOption UpdateOrder {
- get {
- return this._updateOrder;
- }
- set {
- this._updateOrder = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
- "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
- "a", "System.Drawing.Design.UITypeEditor")]
- public dependenciesTableAdapter dependenciesTableAdapter {
- get {
- return this._dependenciesTableAdapter;
- }
- set {
- this._dependenciesTableAdapter = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
- "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
- "a", "System.Drawing.Design.UITypeEditor")]
- public installStatusTableAdapter installStatusTableAdapter {
- get {
- return this._installStatusTableAdapter;
- }
- set {
- this._installStatusTableAdapter = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
- "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
- "a", "System.Drawing.Design.UITypeEditor")]
- public savedepensTableAdapter savedepensTableAdapter {
- get {
- return this._savedepensTableAdapter;
- }
- set {
- this._savedepensTableAdapter = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
- "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
- "a", "System.Drawing.Design.UITypeEditor")]
- public varsTableAdapter varsTableAdapter {
- get {
- return this._varsTableAdapter;
- }
- set {
- this._varsTableAdapter = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" +
- "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" +
- "a", "System.Drawing.Design.UITypeEditor")]
- public scenesTableAdapter scenesTableAdapter {
- get {
- return this._scenesTableAdapter;
- }
- set {
- this._scenesTableAdapter = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public bool BackupDataSetBeforeUpdate {
- get {
- return this._backupDataSetBeforeUpdate;
- }
- set {
- this._backupDataSetBeforeUpdate = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Browsable(false)]
- public global::System.Data.IDbConnection Connection {
- get {
- if ((this._connection != null)) {
- return this._connection;
- }
- if (((this._dependenciesTableAdapter != null)
- && (this._dependenciesTableAdapter.Connection != null))) {
- return this._dependenciesTableAdapter.Connection;
- }
- if (((this._installStatusTableAdapter != null)
- && (this._installStatusTableAdapter.Connection != null))) {
- return this._installStatusTableAdapter.Connection;
- }
- if (((this._savedepensTableAdapter != null)
- && (this._savedepensTableAdapter.Connection != null))) {
- return this._savedepensTableAdapter.Connection;
- }
- if (((this._varsTableAdapter != null)
- && (this._varsTableAdapter.Connection != null))) {
- return this._varsTableAdapter.Connection;
- }
- if (((this._scenesTableAdapter != null)
- && (this._scenesTableAdapter.Connection != null))) {
- return this._scenesTableAdapter.Connection;
- }
- return null;
- }
- set {
- this._connection = value;
- }
- }
-
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- [global::System.ComponentModel.Browsable(false)]
- public int TableAdapterInstanceCount {
- get {
- int count = 0;
- if ((this._dependenciesTableAdapter != null)) {
- count = (count + 1);
- }
- if ((this._installStatusTableAdapter != null)) {
- count = (count + 1);
- }
- if ((this._savedepensTableAdapter != null)) {
- count = (count + 1);
- }
- if ((this._varsTableAdapter != null)) {
- count = (count + 1);
- }
- if ((this._scenesTableAdapter != null)) {
- count = (count + 1);
- }
- return count;
- }
- }
-
- ///
- ///Update rows in top-down order.
- ///
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private int UpdateUpdatedRows(varManagerDataSet dataSet, global::System.Collections.Generic.List allChangedRows, global::System.Collections.Generic.List allAddedRows) {
- int result = 0;
- if ((this._dependenciesTableAdapter != null)) {
- global::System.Data.DataRow[] updatedRows = dataSet.dependencies.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
- updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
- if (((updatedRows != null)
- && (0 < updatedRows.Length))) {
- result = (result + this._dependenciesTableAdapter.Update(updatedRows));
- allChangedRows.AddRange(updatedRows);
- }
- }
- if ((this._installStatusTableAdapter != null)) {
- global::System.Data.DataRow[] updatedRows = dataSet.installStatus.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
- updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
- if (((updatedRows != null)
- && (0 < updatedRows.Length))) {
- result = (result + this._installStatusTableAdapter.Update(updatedRows));
- allChangedRows.AddRange(updatedRows);
- }
- }
- if ((this._savedepensTableAdapter != null)) {
- global::System.Data.DataRow[] updatedRows = dataSet.savedepens.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
- updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
- if (((updatedRows != null)
- && (0 < updatedRows.Length))) {
- result = (result + this._savedepensTableAdapter.Update(updatedRows));
- allChangedRows.AddRange(updatedRows);
- }
- }
- if ((this._varsTableAdapter != null)) {
- global::System.Data.DataRow[] updatedRows = dataSet.vars.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
- updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
- if (((updatedRows != null)
- && (0 < updatedRows.Length))) {
- result = (result + this._varsTableAdapter.Update(updatedRows));
- allChangedRows.AddRange(updatedRows);
- }
- }
- if ((this._scenesTableAdapter != null)) {
- global::System.Data.DataRow[] updatedRows = dataSet.scenes.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent);
- updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows);
- if (((updatedRows != null)
- && (0 < updatedRows.Length))) {
- result = (result + this._scenesTableAdapter.Update(updatedRows));
- allChangedRows.AddRange(updatedRows);
- }
- }
- return result;
- }
-
- ///
- ///Insert rows in top-down order.
- ///
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private int UpdateInsertedRows(varManagerDataSet dataSet, global::System.Collections.Generic.List allAddedRows) {
- int result = 0;
- if ((this._dependenciesTableAdapter != null)) {
- global::System.Data.DataRow[] addedRows = dataSet.dependencies.Select(null, null, global::System.Data.DataViewRowState.Added);
- if (((addedRows != null)
- && (0 < addedRows.Length))) {
- result = (result + this._dependenciesTableAdapter.Update(addedRows));
- allAddedRows.AddRange(addedRows);
- }
- }
- if ((this._installStatusTableAdapter != null)) {
- global::System.Data.DataRow[] addedRows = dataSet.installStatus.Select(null, null, global::System.Data.DataViewRowState.Added);
- if (((addedRows != null)
- && (0 < addedRows.Length))) {
- result = (result + this._installStatusTableAdapter.Update(addedRows));
- allAddedRows.AddRange(addedRows);
- }
- }
- if ((this._savedepensTableAdapter != null)) {
- global::System.Data.DataRow[] addedRows = dataSet.savedepens.Select(null, null, global::System.Data.DataViewRowState.Added);
- if (((addedRows != null)
- && (0 < addedRows.Length))) {
- result = (result + this._savedepensTableAdapter.Update(addedRows));
- allAddedRows.AddRange(addedRows);
- }
- }
- if ((this._varsTableAdapter != null)) {
- global::System.Data.DataRow[] addedRows = dataSet.vars.Select(null, null, global::System.Data.DataViewRowState.Added);
- if (((addedRows != null)
- && (0 < addedRows.Length))) {
- result = (result + this._varsTableAdapter.Update(addedRows));
- allAddedRows.AddRange(addedRows);
- }
- }
- if ((this._scenesTableAdapter != null)) {
- global::System.Data.DataRow[] addedRows = dataSet.scenes.Select(null, null, global::System.Data.DataViewRowState.Added);
- if (((addedRows != null)
- && (0 < addedRows.Length))) {
- result = (result + this._scenesTableAdapter.Update(addedRows));
- allAddedRows.AddRange(addedRows);
- }
- }
- return result;
- }
-
- ///
- ///Delete rows in bottom-up order.
- ///
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private int UpdateDeletedRows(varManagerDataSet dataSet, global::System.Collections.Generic.List allChangedRows) {
- int result = 0;
- if ((this._scenesTableAdapter != null)) {
- global::System.Data.DataRow[] deletedRows = dataSet.scenes.Select(null, null, global::System.Data.DataViewRowState.Deleted);
- if (((deletedRows != null)
- && (0 < deletedRows.Length))) {
- result = (result + this._scenesTableAdapter.Update(deletedRows));
- allChangedRows.AddRange(deletedRows);
- }
- }
- if ((this._varsTableAdapter != null)) {
- global::System.Data.DataRow[] deletedRows = dataSet.vars.Select(null, null, global::System.Data.DataViewRowState.Deleted);
- if (((deletedRows != null)
- && (0 < deletedRows.Length))) {
- result = (result + this._varsTableAdapter.Update(deletedRows));
- allChangedRows.AddRange(deletedRows);
- }
- }
- if ((this._savedepensTableAdapter != null)) {
- global::System.Data.DataRow[] deletedRows = dataSet.savedepens.Select(null, null, global::System.Data.DataViewRowState.Deleted);
- if (((deletedRows != null)
- && (0 < deletedRows.Length))) {
- result = (result + this._savedepensTableAdapter.Update(deletedRows));
- allChangedRows.AddRange(deletedRows);
- }
- }
- if ((this._installStatusTableAdapter != null)) {
- global::System.Data.DataRow[] deletedRows = dataSet.installStatus.Select(null, null, global::System.Data.DataViewRowState.Deleted);
- if (((deletedRows != null)
- && (0 < deletedRows.Length))) {
- result = (result + this._installStatusTableAdapter.Update(deletedRows));
- allChangedRows.AddRange(deletedRows);
- }
- }
- if ((this._dependenciesTableAdapter != null)) {
- global::System.Data.DataRow[] deletedRows = dataSet.dependencies.Select(null, null, global::System.Data.DataViewRowState.Deleted);
- if (((deletedRows != null)
- && (0 < deletedRows.Length))) {
- result = (result + this._dependenciesTableAdapter.Update(deletedRows));
- allChangedRows.AddRange(deletedRows);
- }
- }
- return result;
- }
-
- ///
- ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first
- ///
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List allAddedRows) {
- if (((updatedRows == null)
- || (updatedRows.Length < 1))) {
- return updatedRows;
- }
- if (((allAddedRows == null)
- || (allAddedRows.Count < 1))) {
- return updatedRows;
- }
- global::System.Collections.Generic.List realUpdatedRows = new global::System.Collections.Generic.List();
- for (int i = 0; (i < updatedRows.Length); i = (i + 1)) {
- global::System.Data.DataRow row = updatedRows[i];
- if ((allAddedRows.Contains(row) == false)) {
- realUpdatedRows.Add(row);
- }
- }
- return realUpdatedRows.ToArray();
- }
-
- ///
- ///Update all changes to the dataset.
- ///
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
- public virtual int UpdateAll(varManagerDataSet dataSet) {
- if ((dataSet == null)) {
- throw new global::System.ArgumentNullException("dataSet");
- }
- if ((dataSet.HasChanges() == false)) {
- return 0;
- }
- if (((this._dependenciesTableAdapter != null)
- && (this.MatchTableAdapterConnection(this._dependenciesTableAdapter.Connection) == false))) {
- throw new global::System.ArgumentException("由 TableAdapterManager 管理的所有 TableAdapter 必须使用相同的连接字符串。");
- }
- if (((this._installStatusTableAdapter != null)
- && (this.MatchTableAdapterConnection(this._installStatusTableAdapter.Connection) == false))) {
- throw new global::System.ArgumentException("由 TableAdapterManager 管理的所有 TableAdapter 必须使用相同的连接字符串。");
- }
- if (((this._savedepensTableAdapter != null)
- && (this.MatchTableAdapterConnection(this._savedepensTableAdapter.Connection) == false))) {
- throw new global::System.ArgumentException("由 TableAdapterManager 管理的所有 TableAdapter 必须使用相同的连接字符串。");
- }
- if (((this._varsTableAdapter != null)
- && (this.MatchTableAdapterConnection(this._varsTableAdapter.Connection) == false))) {
- throw new global::System.ArgumentException("由 TableAdapterManager 管理的所有 TableAdapter 必须使用相同的连接字符串。");
- }
- if (((this._scenesTableAdapter != null)
- && (this.MatchTableAdapterConnection(this._scenesTableAdapter.Connection) == false))) {
- throw new global::System.ArgumentException("由 TableAdapterManager 管理的所有 TableAdapter 必须使用相同的连接字符串。");
- }
- global::System.Data.IDbConnection workConnection = this.Connection;
- if ((workConnection == null)) {
- throw new global::System.ApplicationException("TableAdapterManager 不包含任何连接信息。请将每个 TableAdapterManager TableAdapter 属性设置为有效的 Tabl" +
- "eAdapter 实例。");
- }
- bool workConnOpened = false;
- if (((workConnection.State & global::System.Data.ConnectionState.Broken)
- == global::System.Data.ConnectionState.Broken)) {
- workConnection.Close();
- }
- if ((workConnection.State == global::System.Data.ConnectionState.Closed)) {
- workConnection.Open();
- workConnOpened = true;
- }
- global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction();
- if ((workTransaction == null)) {
- throw new global::System.ApplicationException("事务无法开始。当前的数据连接不支持事务或当前状态不允许事务开始。");
- }
- global::System.Collections.Generic.List allChangedRows = new global::System.Collections.Generic.List();
- global::System.Collections.Generic.List allAddedRows = new global::System.Collections.Generic.List();
- global::System.Collections.Generic.List adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List();
- global::System.Collections.Generic.Dictionary