1. Михаил Сафонов
  2. DgvPopupFilter

Commits

Михаил Сафонов  committed 6da7280

+ Localized strings
+ FilterChanged event
~ Fix bug when DataPropertyNamed has more one word

  • Participants
  • Parent commits b934e3b
  • Branches default

Comments (0)

Files changed (16)

File DgvFilterPopup.csproj

View file
  • Ignore whitespace
       <DependentUpon>DgvTextBoxColumnFilter.cs</DependentUpon>
     </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
+<Compile Include="Resources\LocalizedStrings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>LocalizedStrings.resx</DependentUpon>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="FilterPopup\Extensions\DgvDateRangeColumnFilter.resx">
       <SubType>Designer</SubType>
       <DependentUpon>DgvTextBoxColumnFilter.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Resources\LocalizedStrings.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>LocalizedStrings.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Resources\LocalizedStrings.ru.resx" />
   </ItemGroup>
   <ItemGroup>
     <None Include="Diagrams\DetailDiagram.cd" />
     <None Include="Diagrams\Extensions.cd" />
     <None Include="Diagrams\Implementations.cd" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

File DgvFilterPopup.sln

View file
  • Ignore whitespace
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DgvFilterPopup", "DgvFilterPopup.csproj", "{4B9BE5FD-303E-4270-9C4D-FA3BDE6C34EB}"
+EndProject
+Global
+	GlobalSection(MercurialSourceControlSolutionProperties) = preSolution
+		SolutionIsControlled = True
+		SolutionBindings = <Solution Location In Database>
+	EndGlobalSection
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{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
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

File FilterPopup/DgvFilterManager.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Windows.Forms;
 using System.Drawing;
 using System.Data;
 using System.ComponentModel;
+using DgvFilterPopup.Resources;
 
 namespace DgvFilterPopup {
 
         private bool mAutoCreateFilters = true;
         private bool mFilterIsActive = false;
 
+
         #endregion
         
         
         /// </remarks>
         public event ColumnFilterEventHandler PopupShowing;
 
+        public event EventHandler FilterChanged;    // M.S.A [+]
+
 
         #endregion
 
             }
         }
 
+        /// <summary>
+        /// Строка основанная на оригинальном названии столбцов
+        /// </summary>
+        public string ActiveFilterExpression
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Строка на естественном языке
+        /// </summary>
+        public string ActiveFilterDisplay
+        {
+            get;
+            private set;
+        }
 
 
         /// <summary>
         public void RebuildFilter() {
             mFilterIsActive = false;
             string Filter = "";
+            string filterDisplay = "";
             foreach (DgvBaseColumnFilter CF in mColumnFilterList) {
                 if (CF == null) continue;
                 if (CF.Active && CF.FilterExpression != "") {
                     Filter += " AND (" + CF.FilterExpression + ")";
+                    filterDisplay += String.Format(" {0} ({1})", LocalizedStrings.and, CF.FilterCaption);
                     CF.DataGridViewColumn.HeaderText = CF.FilterCaption;
                 }
                 else {
                 }
 
             }
+
+            filterDisplay = filterDisplay.Replace('\n', ' ');   // M.S.A [+]
+
             if (Filter != "") {
                 mFilterIsActive = true;
-                Filter = (mBaseFilter == "") ? "1=1 " + Filter : mBaseFilter + " " + Filter;
+                //Filter = (mBaseFilter == "") ? "1=1 " + Filter : mBaseFilter + " " + Filter;  // M.S.A [-]
+
+                // M.S.A [+] start
+                filterDisplay = filterDisplay.Remove(0, LocalizedStrings.and.Length + 2);   // 2 whitespaces
+
+                if (mBaseFilter == "")
+                    Filter = Filter.Remove(0, 5);
+                else
+                    Filter = mBaseFilter + " " + Filter;
+                // M.S.A [+] end
             }
             else
                 Filter = mBaseFilter;
                 {
                     if (mBoundDataView.RowFilter != Filter)mBoundDataView.RowFilter = Filter;
                 }
+
+                // M.S.A [+] start
+                ActiveFilterExpression = Filter;
+                ActiveFilterDisplay = filterDisplay;
+
+                if (FilterChanged != null)
+                    FilterChanged(this, new EventArgs());
+                // M.S.A [+] end
             } catch { Console.WriteLine ("Invalid filter: " + Filter);}
 
         }

File FilterPopup/Extensions/DgvDateRangeColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
             comboBoxOperator.SelectedValueChanged += new EventHandler(onFilterChanged);
             dateTimePickerValue.TextChanged += new EventHandler(onFilterChanged);
             dateTimePickerValue2.TextChanged += new EventHandler(onFilterChanged);
+
+            dateTimePickerValue.DropDown += dateTimePickerValue_DropDown;
+            dateTimePickerValue2.DropDown += dateTimePickerValue_DropDown;
+            dateTimePickerValue.CloseUp +=dateTimePickerValue_CloseUp;
+            dateTimePickerValue2.CloseUp += dateTimePickerValue_CloseUp;
+        }
+
+        void dateTimePickerValue_CloseUp(object sender, EventArgs e)
+        {
+            this.FilterHost.Popup.AutoClose = true;
+        }
+
+        void dateTimePickerValue_DropDown(object sender, EventArgs e)
+        {
+            this.FilterHost.Popup.AutoClose = false;
         }
 
         /// <summary>
         protected override void OnFilterInitializing(object sender, CancelEventArgs e) {
             base.OnFilterInitializing(sender, e);
             if (e.Cancel) return;
-            comboBoxOperator.Items.AddRange (new object[] { "[...]","=", "<>", ">", "<", "<=", ">=", "= ", "<> " });
+            comboBoxOperator.Items.AddRange (new object[] { "[...]","=", "<>", ">", "<", "<=", ">=", "= Ø", "<> Ø" });
             comboBoxOperator.SelectedIndex = 0;
             this.FilterHost.RegisterComboBox(comboBoxOperator);
         }
             string ResultFilterCaption = OriginalDataGridViewColumnHeaderText ;
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
             FormattedValueUntil = FormatValue(dateTimePickerValue2.Value.AddDays(1), this.ColumnDataType);
 
             if (comboBoxOperator.Text == "[...]") {
-                FilterExpression = this.DataGridViewColumn.DataPropertyName + ">=" + FormattedValue
-                                   + " AND " + this.DataGridViewColumn.DataPropertyName + "<" + FormattedValueUntil;
+                FilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + ">=" + FormattedValue
+                                   + " AND " + "[" + this.DataGridViewColumn.DataPropertyName + "]" + "<" + FormattedValueUntil;
 
                 FilterCaption = OriginalDataGridViewColumnHeaderText +  "\n = [" + dateTimePickerValue.Text + " , "+ dateTimePickerValue2.Text + "]";
             }
             else { 
-                FilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue;
+                FilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + FormattedValue;
                 FilterCaption = OriginalDataGridViewColumnHeaderText  + "\n" + comboBoxOperator.Text + " " + dateTimePickerValue.Text ;
             }
 

File FilterPopup/Extensions/DgvMonthYearColumnFilter.cs

View file
  • Ignore whitespace
                 FilterCaption = OriginalDataGridViewColumnHeaderText + "\n = " + comboBoxMonth.Text+ " " + comboBoxYear.Text;
             }
 
-            FilterExpression = this.DataGridViewColumn.DataPropertyName + " >= " + FormatValue(MinDate, this.ColumnDataType) + " AND " + this.DataGridViewColumn.DataPropertyName + " < " + FormatValue(MaxDate, this.ColumnDataType);
+            FilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " >= " + FormatValue(MinDate, this.ColumnDataType) + " AND " + "[" + this.DataGridViewColumn.DataPropertyName + "]" + " < " + FormatValue(MaxDate, this.ColumnDataType);
             FilterManager.RebuildFilter();
             return;
         }

File FilterPopup/Extensions/DgvNumRangeColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
         protected override void OnFilterInitializing(object sender, CancelEventArgs e) {
             base.OnFilterInitializing(sender, e);
             if (e.Cancel) return;
-            comboBoxOperator.Items.AddRange(new object[] { "[...]","=", "<>", ">", "<", "<=", ">=", "= ", "<> " });
+            comboBoxOperator.Items.AddRange(new object[] { "[...]", "=", "<>", ">", "<", "<=", ">=", "= Ø", "<> Ø" });
             comboBoxOperator.SelectedIndex = 0;
             this.FilterHost.RegisterComboBox(comboBoxOperator);
         }
             string ResultFilterExpression = "";
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
 
             if (comboBoxOperator.Text == "[...]") {
                 if (FormattedValue != "" && FormattedValue2 != "" ) {
-                    FilterExpression = this.DataGridViewColumn.DataPropertyName + ">=" + FormattedValue
-                                       + " AND " + this.DataGridViewColumn.DataPropertyName + "<=" + FormattedValue2;
+                    FilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + ">=" + FormattedValue
+                                       + " AND " + "[" + this.DataGridViewColumn.DataPropertyName + "]" + "<=" + FormattedValue2;
                     FilterCaption = OriginalDataGridViewColumnHeaderText +  "\n = [" + textBoxValue.Text + " , "+ textBoxValue2.Text  + "]";
                     FilterManager.RebuildFilter();
                 }
             } 
             else {
                 if (FormattedValue != "") {
-                    FilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue ;
+                    FilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + FormattedValue ;
                     FilterCaption = OriginalDataGridViewColumnHeaderText +  "\n" + comboBoxOperator.Text + " " + textBoxValue.Text;
                     FilterManager.RebuildFilter();
                 }

File FilterPopup/Implementations/DgvCheckBoxColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
         protected override void OnFilterInitializing(object sender, CancelEventArgs e) {
             base.OnFilterInitializing(sender, e);
             if (e.Cancel) return;
-            comboBoxOperator.Items.AddRange (new object[] { "=","= ", "<> " });
+            comboBoxOperator.Items.AddRange(new object[] { "=", "= Ø", "<> Ø" });
             comboBoxOperator.SelectedIndex = 0;
             this.FilterHost.RegisterComboBox(comboBoxOperator);
 
             string ResultFilterCaption = OriginalDataGridViewColumnHeaderText ;
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
             }
 
             if (checkBoxValue.Checked){
-                    ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " = 1" ;
+                    ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " = 1" ;
                     ResultFilterCaption += "\n = yes" ;
             }
             else {
-                    ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " = 0" ;
+                    ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " = 0" ;
                     ResultFilterCaption += "\n = no" ;
             }
 

File FilterPopup/Implementations/DgvComboBoxColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
         protected override void OnFilterInitializing(object sender, CancelEventArgs e) {
             base.OnFilterInitializing(sender, e);
             if (e.Cancel) return;
-            comboBoxOperator.Items.AddRange (new object[] { "=", "<>", "= ", "<> " });
+            comboBoxOperator.Items.AddRange(new object[] { "=", "<>", "= Ø", "<> Ø" });
             comboBoxOperator.SelectedIndex = 0;
             if (this.DataGridViewColumn is DataGridViewComboBoxColumn) {
                 comboBoxValue.ValueMember = ((DataGridViewComboBoxColumn)DataGridViewColumn).ValueMember;
             string ResultFilterCaption = OriginalDataGridViewColumnHeaderText ;
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
             if (ColumnDataType == typeof(string)) {
                 // Managing the string-column case
                 string EscapedFilterValue = StringEscape(FilterValue.ToString());
-                ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + "'" + EscapedFilterValue + "'";
+                ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + "'" + EscapedFilterValue + "'";
                 ResultFilterCaption += "\n" + comboBoxOperator.Text + " " + comboBoxValue.Text;
             }
             else {
                 // Managing the other cases
                 FormattedValue = FormatValue(FilterValue, this.ColumnDataType);
                 if (FormattedValue != "") {
-                    ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue ;
+                    ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + FormattedValue ;
                     ResultFilterCaption += "\n" + comboBoxOperator.Text + " " + comboBoxValue.Text ;
                 }
 

File FilterPopup/Implementations/DgvDateColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
             InitializeComponent();
             comboBoxOperator.SelectedValueChanged += new EventHandler(onFilterChanged);
             dateTimePickerValue.TextChanged += new EventHandler(onFilterChanged);
+            dateTimePickerValue.DropDown += dateTimePickerValue_DropDown;
+            dateTimePickerValue.CloseUp += dateTimePickerValue_CloseUp;
+        }
+
+        void dateTimePickerValue_CloseUp(object sender, EventArgs e)
+        {
+            this.FilterHost.Popup.AutoClose = true;
+        }
+
+        void dateTimePickerValue_DropDown(object sender, EventArgs e)
+        {
+            this.FilterHost.Popup.AutoClose = false;
         }
 
         /// <summary>
         protected override void OnFilterInitializing(object sender, CancelEventArgs e) {
             base.OnFilterInitializing(sender, e);
             if (e.Cancel) return;
-            comboBoxOperator.Items.AddRange (new object[] { "=", "<>", ">", "<", "<=", ">=", "= ", "<> " });
+            comboBoxOperator.Items.AddRange (new object[] { "=", "<>", ">", "<", "<=", ">=", "= Ø", "<> Ø" });
             comboBoxOperator.SelectedIndex = 0;
             this.FilterHost.RegisterComboBox(comboBoxOperator);
         }
             string ResultFilterCaption = OriginalDataGridViewColumnHeaderText ;
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
             
             FormattedValue = FormatValue(FilterValue, this.ColumnDataType);
             if (FormattedValue != "") {
-                ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue;
+                ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + FormattedValue;
                 ResultFilterCaption += "\n" + comboBoxOperator.Text + " " + dateTimePickerValue.Text ;
             }
 

File FilterPopup/Implementations/DgvFilterHost.Designer.cs

View file
  • Ignore whitespace
             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";
+            resources.ApplyResources(this.tsRemove, "tsRemove");
             this.tsRemove.Click += new System.EventHandler(this.tsRemove_Click);
             // 
             // tsOK
             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";
+            resources.ApplyResources(this.tsRemoveAll, "tsRemoveAll");
             this.tsRemoveAll.Click += new System.EventHandler(this.tsRemoveAll_Click);
             // 
             // panel1

File FilterPopup/Implementations/DgvFilterHost.resx

View file
  • Ignore whitespace
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
     <value>17, 17</value>
-  </metadata>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  </data>
   <data name="tsRemove.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
   <data name="tsOK.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAA1FJREFUOE9Vk2tM
-        k1ccxl++zI/7vGXf92ExBhemQckE5NJBi+Xa1bAYYERBbEegpRaZQkVLGONWREHKJUwUsNBBmWVFZVOL
-        xKgMGHMXlt3CNnREaQVa+O3wmi1yPrznJO/5/Z/n/M9zQqSXxi///MzAVK/03eKMJL0iSdu2iQ8hkt/v
-        kwK+dSn0jTApJVQjvfbq6yEvc/L61k830TmyafumAe/ql3g2Bul/1on9twZs31ux3v+YY0NZqGzROB/0
-        s6XAnfmvKHblcfupm2m8uNevcunxBZrnq6mZsQj4BJYJE+UTRoyjecTUhHPlbveLIovLf2Ny6ZjweXjI
-        LYbWLtOxYKPu20rO3i8VkIGTd4owj+vJdWjRjWSR7zzEvjNh/PDnI6ThmQFsD6xMcRtX4Ar2PxqpmS6n
-        QqiVfV2I+eYxSm4UkNYeT427EudcH/rPc0htUVDUU4BU6DzC2HMnoxsOOheaqJ21yKrmcR3G6wUYPHmo
-        L8ZyymkiuB5kNbiCeaSQg50HSKyNQtJf+5CRYC89T1qpm6ukeOwwx4WqcewoxZ58UtviKXUUsbzyjLXg
-        Gue9dWR2q0UBNfuqwpAMYtOAr1tumG22irobVrSdKkquHxW2FZj69awEnrM5WrwNpHe9J/4noW1PIrp6
-        N5JuOEe2fvZhKfcWvQSCAcoHjxPXuIeSPh3+VT8bGxu03G0ivVMhwxltStJaE4is2oWU06cRHT+NZdLE
-        p5OVPF1dEpCPikEz/jWfrNw6YSOlPQ5tl0rACaRciOfAuVgiKncilQ0ZKPcaqPAa0buzqfda/7e8CV+c
-        aCK5PZb3xbEy7EoZTmqKIbE+EkX1u0ijsy5yrx7kxPhHFF07TJYjHfu9Zn5f+pUznjJS7EK5Qykrp8rw
-        flQNUXIO6t3VSEv+JTLOKcnp1aAbzuaII5PMHjU5l7XyDWjaN8+rQH0+TsR4P4kCjvtkL7tObufRwtyL
-        NLqmnERa3yGzK5ncXi2HPksTXVaiEZY3A6NuFnBjtLAdRWz1XnaWvkntF1Vb34N72oWqNkbOucoWRbKA
-        0loS5Fkpq0YQXrGDsLK3aHDXbIX/e1lPlh/TN3mJXPsH7D61nfDyHew5HSrPEZa3ye/IZv6vH7fA/wKc
-        HWuGuC8pEQAAAABJRU5ErkJggg==
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAA0NJREFUOE9tk/tP
+        01cYxr//zX5YjJkL06BkAnIbtFju1rEQ6DqkYpFACxaZQq2WsQ4oRRSkUMZEASsVyigrAptaJMbLkBF3
+        YdnFsU0dU0AutZ8dviZGkp1fzknO+bzPc97zHEl6bfzyz880jH+Cri8H3ZUcin1aioc/It/9Pnmf76Nx
+        zMYf/z7kdebV+tpP4+jdebR9ayew+hX+UD99z1w4f7Pj+N6K9fbHHBrIRemIxnOnb3ORG3NfU+ot4PpT
+        H9ME8L24xPnHZ2meq8V23yzgo5gny6maNGIcKSDGFs7Fm10vizxa/Jtyr57JJT93ucbA2gU65h3Uf2fh
+        1O0KARk4dqME00QRWrca/VAuOk8Ou0+G8cOfD5AG71/GccfKPa7jXb+I82EjtukqqoVa5TfFmMYPUTZW
+        SHp7PDafBc9sL0VXNKS1JFDSXYhU7DnA6HMPIyE3rvkm6mbMsqppQo/xaiEGfwGqc7Ec95QTfBFkNbiC
+        aaiY/a69JNVFIRUNf8hQsIfuJ63Uz1ooHc3niFA1jh6k1K8jrS2eCncJiyvPWAuucSZQT3aXShRQsbsm
+        DMkgDl1e6pIb5pipoX7MitqlpOzqQWE7gfK+IlbWn7MxWgJ2MjrfE/vJqNuTia7dgaQf1MjWT92t4Naj
+        AOvBdar6jxDXuJOyXj3Lq8uEQiFabjaR4UqQ4cw2BemtiUTWbEfS9GaJjp/APFXOZ1MWnq4uCGiJ6n4T
+        y2tLsnLrpIPU9jjUnUoBJ5J6Np69p2OJsGxDqhwwUBUwUB0wUuTLoyFgfWV5Az432URKeyz7xLUynQoZ
+        Tm6KIakhkoTad5FGZrxoL+3n6MRhSobzyXVn4LzVzO8Lv3LSX0mqUyh3KGTlNBneg9IeJeegwVeLtLC8
+        QOZpBZqeLPSDeRxwZ5PdrUJzQS2/QFb7xn0TUJ2JEzHeQ5KA4z7dxfZjW3gwP/syjd57HiKt75DdmYK2
+        R03OF+miywqyhOWNwKiaBdwYLWxHEVu7i20Vb1D3Zc3m/+Cb9qKsi5FzrnREkSKg9JZEeVbIqhGEV28l
+        rPJN7D7b///IJ4uP6Z06j9b5ATuObyG8ais7T7wlzxHmt9F15DH314+b4P8A8aF2l88tBe8AAAAASUVO
+        RK5CYII=
 </value>
   </data>
   <data name="tsRemoveAll.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAApBJREFUOE99kl1I
-        k2EUx8+oqU236Vw2FiqCQQs19UIp9MKim0LoAyS8KTKUiCxHdGF+5LISpyXlKmNqhrbyO7TyKxUzylyw
-        UlmGw6kYuFKxOYv58e99X5kU7+qBc/PA//c75zmPgNyctvJUrNjeEi3PktBjjTw2r5HIY4W8hCu0SbBG
-        v1YlNOWMpCMZLwS8+Gt9Ii6fCOTVqxI5PpRJYa3ZAnuzEOgSoq44ERyANbbeCEerRon2AgV6igIwcFuG
-        j/ckGL7vA6NOyQEHdWKYy70xWuGNz2UiPK0sBLHG3lsq1GgiUJEViuorQWi6roQ7IwvpKw1Gf7EUj/P3
-        rdtNnQUYe34MLYU78SRnO1MBaL7qjy6tL8/IArpvKvEyX74edp2Z0bvAVAkW3iXD1hmHmfY9sHXshaUx
-        esPIhk2PwtCrlaGiKO1vAAvCvB6YvgOYTwFDR7FqOozx+GCMhMu5+ed7EvC+LAQ1ubvwjWQGG/k18TaA
-        H1XAWB7wKQlzB3YA6ZmAOgemyFBMt8Sgt1iB4dgo4EI2U1kwk9TAh8w+BL6oMRcXApw8B8eZi1jK02Jm
-        fyCMsSosaYrgOJ8JpzqbAbjp4ifzFpjI5YyWKC8spqmxmJIOx9lLcGRkcbWg0cJCxB/B1Q7MxzHZEIbK
-        awcxS756e9Jp2JNTsRCdgGmFCuMkqXL3gzfuRjrSYTZEo621Ad/FQbr5wAgGJMIE+WKE/NBN4gf/BRjf
-        1GOoLhFfDyUxQX+upkjGhQcYSDdJYSDxv0cY7K+HNT4cyyTnwpNM2Bi7mzOz4WckQR35oNRTxt8C29pg
-        Xy0sMRFwCrYyO/eH9Y/XZs1sWM8B3GyBBfS0VaNWlwKrp8Jg9dzGa5U1u8K/ARwlsVnRUK59AAAAAElF
-        TkSuQmCC
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmdJREFUOE+NkltI
+        k3EYh/9diKXOwzQbCxXBIEMtvVAKvbDophCiQMKbIkOJyGpEF+YhzUqcppSrDA8Z2spDGhp5SsUMMhes
+        VJbhcCoGWiqmMzDi6fs+MYqt6IP35oPf87yHvxBOvraKFFqvh9Oaq6U9X0NPoT8DN9W8u+PJ8F0PTAYt
+        TcUHcJYVL8sTuHQswKFelPjxtswLW+0mlppdoMuF+qKENcj/GGXooEGFpcKd0Up3PpS58biqAMXYWxxK
+        bW4ElRkh1FwOpOmaFmdGGdJXGkR/kRcP8/au2c2d+Yw9O0JLwXYeZW2Vyp/mK7506b0djDKg+4aW53l+
+        f84/M3obpkpYfJ3EbGcsM+27me3Yg/VJ1C+jHDY/CKNXr6ayMNVxgSyUw/QtsJyAocP8MB9iPC6IkXA/
+        ZaELPfG8KQumNnsHn4XaOCt8mhyuwNdqGMuB94nM798Gaemgy8K8K4Tplmh6izQMx0TCuUypMrAIL6Mj
+        ZO4+fNQxHxsMx89gP3WBlRw9M/sCMMWEspJbiP1sOqu6TAngpItv0i6YyFaM1siNLKfqWE5Ow376Ivbz
+        GUot5uqxCuE4wno7WI4y2RhG1dUDzAnv8qXEkywlpbAYFc+0JpRx4Vnt9BWu/xzpSMNijKKttZEvqkDD
+        QkCEBHJjQngzInzoFqp7/wSYXjUwVJ/Ap4OJUtBXqSmhVsIDEqRbeGEUqr+PMNjfgC0unO/CTwlPSmFT
+        zE7FLIefCk/qhQelrmrHK8itDfbVYY2OYHXDZunmvth+27ZslsPlCsDJFWRAT1sNdYZkbK4ao811i0Or
+        snk9/BN70LfZPmIxxgAAAABJRU5ErkJggg==
 </value>
   </data>
   <data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
-        R0lGODlhEAAQAPYAAPLy8vf39rmypOm5Oeq6Oqh+G+rq6v/XWMuVDauNTah+FtmeC725s/3QULSCGqmf
+        R0lGODlhEAAQAIYAAPLy8vf39rmypOm5Oeq6Oqh+G+rq6v/XWMuVDauNTah+FtmeC725s/3QULSCGqmf
         isCLEv/hf9edC6efj9SYDLCDE6+PSuHe2MvErO+/QeTj4cvCquLf3MzIwMSND7i0raSAHt2uMszEsZ+F
         SsCPKf/vnNC7iMvAnr+4pMW5kbmIGOWzNsKUH/fjkNGXDv/XYreEFMzFrPfISaV/KtjY17myot/Ni/v7
         +9CiLNy1U96xOevr67+3qdiZCtOrTeq7PP/jkM/MxbOKKMCNGL+MFv/yocyVGtPS0f/toPX19OXl5aqV
         Y+KtLOClCb+6rsmSEv/actW6bvn5+fOwBZ6MZ+no5vHIWv/cgenZlv/SVv/TUryLEM2ZD8jFwK+GGr6O
         GrmbWv+8BdenMtrZ2KaEQsOcTb67tsWjVOzq6Z58JPDt6cqZIbidZvb29v/lk7SHLaWCLr2QFOjj3P//
-        /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAHMALAAAAAAQABAAAAeXgHOC
-        c1UdPDUCTl1jbYOCF2xvDipETy4URhZmN4JyZSRwaSBecVxNU2EJAIJqJjlCBQoVWwgSCz0PjhxYQFY/
-        AwQhLB5kO45zIiVuL1oNOl8wDMeCKUVXWTI4EFRS03NoNkhQGWszR96CQS0RK0MT6IMnB0wjBvCCAVFi
-        H/eDMT40+gnCcEaJwDkbwKwSiGLJwTlJNHgLBAA7
+        /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEBAAAh+QQB
+        AABzACwAAAAAEAAQAAAIpwDnCJxTpQOPGgKcdBnTZqDAC2zeOFBB5IkLCkYsmLkhUE4ZEnDSgPASh0uT
+        KWESABCoxkQOIQUUVNiCQMKCHg8ccsACxMqPAQRCsPBAZofDOSJKuHmhpYGOLzAYHBWYosiVLDJwQKAi
+        ZeocNDaQQMmwZsYRrwKDtIiwYsgEtANPHGAywgBcgQGiiPlwd2AMHzT6CsRwRongORvArBSMYsnhOUk0
+        eA0IADs=
 </value>
   </data>
+  <data name="tsRemove.Text" xml:space="preserve">
+    <value>Remove filter</value>
+  </data>
+  <data name="tsRemove.ToolTipText" xml:space="preserve">
+    <value>Remove filter</value>
+  </data>
+  <data name="tsRemoveAll.Text" xml:space="preserve">
+    <value>Remove all</value>
+  </data>
+  <data name="tsRemoveAll.ToolTipText" xml:space="preserve">
+    <value>Remove all</value>
+  </data>
 </root>

File FilterPopup/Implementations/DgvTextBoxColumnFilter.cs

View file
  • Ignore whitespace
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Drawing;
             if (e.Cancel) return;
 
             if (ColumnDataType == typeof(string))
-                comboBoxOperator.Items.AddRange (new object[] { "..xxx..","xxx..","..xxx" , "=", "<>", "= ", "<> " });
+                comboBoxOperator.Items.AddRange (new object[] { "..xxx..","xxx..","..xxx" , "=", "<>", "= Ø", "<> Ø" });
             else
-                comboBoxOperator.Items.AddRange(new object[] { "=", "<>", ">", "<", "<=", ">=", "= ", "<> " });
+                comboBoxOperator.Items.AddRange(new object[] { "=", "<>", ">", "<", "<=", ">=", "= Ø", "<> Ø" });
 
             comboBoxOperator.SelectedIndex = 0;
             this.FilterHost.RegisterComboBox(comboBoxOperator);
             string FormattedValue = "";
 
             // Managing the NULL and NOT NULL cases which are type-independent
-            if (comboBoxOperator.Text == "= �") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
-            if (comboBoxOperator.Text == "<> �") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "= Ø") ResultFilterExpression = GetNullCondition(this.DataGridViewColumn.DataPropertyName);
+            if (comboBoxOperator.Text == "<> Ø") ResultFilterExpression = GetNotNullCondition(this.DataGridViewColumn.DataPropertyName);
 
             if (ResultFilterExpression != "") {
                 FilterExpression = ResultFilterExpression;
                 FilterManager.RebuildFilter();
                 return;
             }
-            
+
+            if (FilterValue == "")
+            {
+                Active = false;
+                FilterManager.RebuildFilter();
+                return;
+            }
+
             if (ColumnDataType == typeof(string)) {
                 // Managing the string-column case
                 FilterValue = StringEscape(FilterValue);
                 switch (comboBoxOperator.Text) {
                     case "..xxx..":
-                        ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " LIKE '%" + FilterValue + "%'";
+                        ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " LIKE '%" + FilterValue + "%'";
                         ResultFilterCaption += "\n = '.." + FilterValue + "..'";
                         break;
                     case "xxx..":
-                        ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " LIKE '" + FilterValue + "%'";
+                        ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " LIKE '" + FilterValue + "%'";
                         ResultFilterCaption += "\n = '" + FilterValue + "..'";
                         break;
                     case "..xxx":
-                        ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " LIKE '%" + FilterValue + "'";
+                        ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " LIKE '%" + FilterValue + "'";
                         ResultFilterCaption += "\n = '.." + FilterValue + "'";
                         break;
                     default:
-                        ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + "'" + FilterValue + "'";
+                        ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + "'" + FilterValue + "'";
                         ResultFilterCaption += "\n" + comboBoxOperator.Text + "'" + FilterValue + "'";
                         break;
                 }
                 // Managing the numeric-column case
                 FormattedValue = FormatValue(FilterValue, this.ColumnDataType);
                 if (FormattedValue != "") {
-                    ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " " + comboBoxOperator.Text + FormattedValue ;
+                    ResultFilterExpression = "[" + this.DataGridViewColumn.DataPropertyName + "]" + " " + comboBoxOperator.Text + FormattedValue;
                     ResultFilterCaption += "\n" + comboBoxOperator.Text + "'" + FilterValue + "'";
                 }
 

File Properties/AssemblyInfo.cs

View file
  • Ignore whitespace
 [assembly: AssemblyTitle("DgvFilterPopup")]
 [assembly: AssemblyDescription("A flexible library to add filtering capabilities to a DataGridView")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Vincenzo Rossi")]
+[assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("DgvFilterPopup")]
 [assembly: AssemblyCopyright("Copyright ©  2009")]
 [assembly: AssemblyTrademark("")]
 //
 // You can specify all the values or you can default the Revision and Build Numbers 
 // by using the '*' as shown below:
-[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.5.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]

File Resources/LocalizedStrings.Designer.cs

View file
  • Ignore whitespace
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.17929
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DgvFilterPopup.Resources {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // 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", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class LocalizedStrings {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal LocalizedStrings() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [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.Resources.LocalizedStrings", typeof(LocalizedStrings).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to and.
+        /// </summary>
+        internal static string and {
+            get {
+                return ResourceManager.GetString("and", resourceCulture);
+            }
+        }
+    }
+}

File Resources/LocalizedStrings.resx

View file
  • Ignore whitespace
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="and" xml:space="preserve">
+    <value>and</value>
+  </data>
+</root>

File Resources/LocalizedStrings.ru.resx

View file
  • Ignore whitespace
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="and" xml:space="preserve">
+    <value>и</value>
+  </data>
+</root>