LookupGrid: Remove old Versions, Fix Null Value Text \o/

This commit is contained in:
Jonathan Jenne 2021-04-29 12:25:43 +02:00
parent 817347af6f
commit aa1e11b030
13 changed files with 28 additions and 1043 deletions

View File

@ -1,38 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class LookupControl
Inherits System.Windows.Forms.UserControl
'UserControl überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.SuspendLayout()
'
'LookupControl
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
Me.BackColor = System.Drawing.Color.Transparent
Me.Name = "LookupControl"
Me.Size = New System.Drawing.Size(270, 35)
Me.ResumeLayout(False)
End Sub
End Class

View File

@ -1,120 +0,0 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,137 +0,0 @@

Imports System.ComponentModel
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Controls
Public Class LookupControl
<Category("Einstellungen"), Description("Gibt an, ob mehrere Werte auswählbar sind"), DefaultValue(False)>
Public Property MultiSelect As Boolean
<Category("Einstellungen"), Description("Gibt an, ob neue Werte hinzugefügt werden können"), DefaultValue(False)>
Public Property AllowAddNewValues As Boolean
<Category("Einstellungen"), Description("Gibt an, ob das Hinzufügen von identischen Werten erlaubt ist"), DefaultValue(False)>
Public Property PreventDuplicates As Boolean
Public Property DataSource As DataTable
Public Property SelectedValues As List(Of String)
Get
If _selectedValues Is Nothing Then
Return New List(Of String)
End If
Return _selectedValues
End Get
Set(value As List(Of String))
_selectedValues = value
UpdateSelectedValues(value)
End Set
End Property
Private _selectedValues As List(Of String)
Private _lookupControlMulti As GridLookUpEdit
Private _lookupControlSingle As ButtonEdit
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
Private Const TEXT_NO_RECORDS = "Keine Datensätze ausgewählt"
Private Const TEXT_N_RECORDS = "{0} Datensätze ausgewählt"
Private Function GetLookupForm() As frmLookupGrid
Dim oForm As New frmLookupGrid() With {
.MultiSelect = MultiSelect,
.AddNewValues = AllowAddNewValues,
.PreventDuplicates = PreventDuplicates,
.DataSource = DataSource,
.SelectedValues = SelectedValues,
.StartPosition = Windows.Forms.FormStartPosition.Manual,
.Location = PointToScreen(New System.Drawing.Point(Width, 0))
}
Return oForm
End Function
Private Sub Grid_Load(sender As Object, e As EventArgs) Handles Me.Load
If MultiSelect = False Then
_lookupControlSingle = New ButtonEdit With {
.Dock = Windows.Forms.DockStyle.Fill
}
AddHandler _lookupControlSingle.ButtonClick, AddressOf lookupControlSingle_ButtonClick
Controls.Add(_lookupControlSingle)
Else
_lookupControlMulti = New GridLookUpEdit With {
.Dock = Windows.Forms.DockStyle.Fill
}
With _lookupControlMulti.Properties
.View.OptionsBehavior.ReadOnly = True
.View.OptionsBehavior.Editable = False
.View.OptionsView.ShowColumnHeaders = False
.PopupFormSize = New System.Drawing.Size(.PopupFormSize.Width, 100)
End With
_lookupControlMulti.Properties.Buttons.Add(New EditorButton() With {
.Kind = ButtonPredefines.Ellipsis,
.Tag = TAG_BUTTON_LOOKUP_FORM
})
AddHandler _lookupControlMulti.ButtonClick, AddressOf lookupControlMulti_ButtonClick
AddHandler _lookupControlMulti.EditValueChanging, AddressOf lookupControlMulti_EditValueChanging
Controls.Add(_lookupControlMulti)
End If
UpdateSelectedValues(SelectedValues)
End Sub
Private Sub UpdateSelectedValues(Values As List(Of String))
If MultiSelect = True Then
_lookupControlMulti.Properties.DataSource = Values
_lookupControlMulti.Properties.NullText = IIf(Values.Count = 0, TEXT_NO_RECORDS, String.Format(TEXT_N_RECORDS, Values.Count))
Else
_lookupControlSingle.Text = Values.FirstOrDefault()
End If
End Sub
Private Sub lookupControlMulti_EditValueChanging(sender As Object, e As ChangingEventArgs)
e.Cancel = True
End Sub
Private Sub lookupControlMulti_ButtonClick(sender As Object, e As ButtonPressedEventArgs)
If e.Button.Tag <> TAG_BUTTON_LOOKUP_FORM Then
Exit Sub
End If
Dim oForm As frmLookupGrid = GetLookupForm()
Dim oResult = oForm.ShowDialog()
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
UpdateSelectedValues(oValues)
SelectedValues = oValues
End If
oForm.Dispose()
End Sub
Private Sub lookupControlSingle_ButtonClick(sender As Object, e As ButtonPressedEventArgs)
Dim oForm As frmLookupGrid = GetLookupForm()
Dim oResult = oForm.ShowDialog()
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
UpdateSelectedValues(oValues)
SelectedValues = oValues
End If
oForm.Dispose()
End Sub
End Class

View File

@ -98,23 +98,7 @@
<Compile Include="frmLookupGrid.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="LookupControl.Designer.vb">
<DependentUpon>LookupControl.vb</DependentUpon>
</Compile>
<Compile Include="LookupControl.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="LookupControl2.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="LookupGridHandler.vb" />
<Compile Include="LookupGridRegistration.vb" />
<Compile Include="LookupGridView.Designer.vb">
<DependentUpon>LookupGridView.vb</DependentUpon>
</Compile>
<Compile Include="LookupGridView.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="LookupGridLocalizer.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@ -154,12 +138,6 @@
<EmbeddedResource Include="frmLookupGrid.resx">
<DependentUpon>frmLookupGrid.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl.resx">
<DependentUpon>LookupControl.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl2.resx">
<DependentUpon>LookupControl2.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl3.resx">
<DependentUpon>LookupControl3.vb</DependentUpon>
</EmbeddedResource>

View File

@ -1,180 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3DCD6D1A-C830-4241-B7E4-27430E7EA483}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DigitalData.Controls.LookupGrid</RootNamespace>
<AssemblyName>DigitalData.Controls.LookupGrid</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.Controls.LookupGrid.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.Controls.LookupGrid.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a">
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="DevExpress.Office.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Office.v18.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Pdf.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Pdf.v18.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Printing.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.Printing.v18.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.RichEdit.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.RichEdit.v18.1.Core.dll</HintPath>
</Reference>
<Reference Include="DevExpress.RichEdit.v18.1.Export, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.RichEdit.v18.1.Export.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Utils.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.XtraLayout.v18.1.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraPrinting.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>D:\ProgramFiles\DevExpress 18.1\Components\Bin\Framework\DevExpress.XtraPrinting.v18.1.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmLookupGrid.Designer.vb">
<DependentUpon>frmLookupGrid.vb</DependentUpon>
</Compile>
<Compile Include="frmLookupGrid.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="LookupControl.Designer.vb">
<DependentUpon>LookupControl.vb</DependentUpon>
</Compile>
<Compile Include="LookupControl.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="LookupControl2.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="LookupGridHandler.vb" />
<Compile Include="LookupGridRegistration.vb" />
<Compile Include="LookupGridView.Designer.vb">
<DependentUpon>LookupGridView.vb</DependentUpon>
</Compile>
<Compile Include="LookupGridView.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="LookupGridControl.Designer.vb">
<DependentUpon>LookupGridControl.vb</DependentUpon>
</Compile>
<Compile Include="LookupGridControl.vb">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="frmLookupGrid.resx">
<DependentUpon>frmLookupGrid.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl.resx">
<DependentUpon>LookupControl.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl2.resx">
<DependentUpon>LookupControl2.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{94E38DFF-614B-4CBD-B67C-F211BB35CE8B}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@ -1,123 +0,0 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -1,272 +0,0 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.Accessibility
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Drawing
Imports DevExpress.XtraEditors.Registrator
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraEditors.ViewInfo
Imports DevExpress.XtraEditors.Controls
<ToolboxItem(True)>
Public Class LookupControl2
Inherits GridLookUpEdit
Public Delegate Sub SelectedValuesChangedHandler(sender As Object, SelectedValues As List(Of String))
Public Event SelectedValuesChanged As SelectedValuesChangedHandler
Public Property AllowAddNewValues As Boolean
Public Property PreventDuplicates As Boolean
Public Property DataSource As DataTable
Public Property MultiSelect As Boolean
Get
Return _Multiselect
End Get
Set(value As Boolean)
SetDropdownButtonEnabled(value)
_MultiSelect = value
End Set
End Property
Public Property SelectedValues As List(Of String)
Get
Return _SelectedValues
End Get
Set(value As List(Of String))
UpdateSelectedValues(value)
End Set
End Property
Public Overloads Property [ReadOnly] As Boolean
Get
Return _ReadOnly
End Get
Set(value As Boolean)
SetFormButtonEnabled(Not value)
_ReadOnly = value
End Set
End Property
Private ReadOnly _LookupFormButton As EditorButton
Private Const TAG_DROPDOWN = "openDropdown"
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
Private _R As Resources.ResourceManager = My.Resources.Strings.ResourceManager
Private _SelectedValues As New List(Of String)
Private _MultiSelect As Boolean
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents GridView2 As DevExpress.XtraGrid.Views.Grid.GridView
Friend WithEvents fProperties As RepositoryItemGridLookUpEdit
Friend WithEvents fPropertiesView As DevExpress.XtraGrid.Views.Grid.GridView
Private _ReadOnly As Boolean = False
Shared Sub New()
RepositoryItemLookupControl2.RegisterLookupControl2()
End Sub
Public Sub New()
MyClass.New(MultiSelect:=False)
End Sub
Public Sub New(MultiSelect As Boolean)
_LookupFormButton = New EditorButton() With {
.Kind = ButtonPredefines.Search,
.Tag = TAG_BUTTON_LOOKUP_FORM,
.Width = 20
}
Properties.Buttons.Item(0).Tag = TAG_DROPDOWN
Properties.Buttons.AddRange({_LookupFormButton})
Properties.NullText = _R.GetString("LookupControl_NoRecords")
AddHandler ButtonClick, AddressOf HandleButtonClick
AddHandler EditValueChanging, AddressOf HandleEditValueChanging
AddHandler QueryPopUp, AddressOf HandleQueryPopup
End Sub
Private Sub SetFormButtonEnabled(pVisible As Boolean)
Dim oButton As EditorButton = Properties.Buttons.
Where(Function(b) b.Tag = TAG_BUTTON_LOOKUP_FORM).
FirstOrDefault()
If oButton IsNot Nothing Then
oButton.Visible = pVisible
End If
End Sub
Private Sub SetDropdownButtonEnabled(pVisible As Boolean)
Dim oButton As EditorButton = Properties.Buttons.
Where(Function(b) b.Tag = TAG_DROPDOWN).
FirstOrDefault()
If oButton IsNot Nothing Then
oButton.Visible = pVisible
End If
End Sub
''' <summary>
''' Prevents popup from opening when multiselect is false
''' </summary>
Private Sub HandleQueryPopup(sender As Object, e As CancelEventArgs)
If MultiSelect = False Then
e.Cancel = True
End If
End Sub
''' <summary>
''' Prevents Editvalue changing when multiselect is true
''' </summary>
Private Sub HandleEditValueChanging(sender As Object, e As ChangingEventArgs)
If MultiSelect Then
e.Cancel = True
End If
End Sub
''' <summary>
''' Handles opening frmLookup when ellipsis button is clicked
''' </summary>
Private Sub HandleButtonClick(sender As Object, e As ButtonPressedEventArgs)
Select Case e.Button.Tag
Case TAG_BUTTON_LOOKUP_FORM
Using oForm = GetLookupForm()
Dim oResult = oForm.ShowDialog()
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
UpdateSelectedValues(oValues)
End If
End Using
End Select
End Sub
Private Sub UpdateSelectedValues(Values As List(Of String))
If Values Is Nothing Then
Exit Sub
End If
Values.RemoveAll(Function(v) String.IsNullOrEmpty(v))
If MultiSelect = True Then
Properties.DataSource = Values
Select Case Values.Count
Case 0
Properties.NullText = _R.GetString("LookupControl_NoRecords")
Case 1
Properties.NullText = _R.GetString("LookupControl_OneRecord")
Case Else
Properties.NullText = String.Format(_R.GetString("LookupControl_NRecords"), Values.Count)
End Select
Else
Properties.NullText = Values.FirstOrDefault()
Text = Values.FirstOrDefault()
EditValue = Nothing
End If
_SelectedValues = Values
RaiseEvent SelectedValuesChanged(Me, Values)
End Sub
Private Function GetLookupForm() As frmLookupGrid
Dim oForm As New frmLookupGrid() With {
.MultiSelect = MultiSelect,
.AddNewValues = AllowAddNewValues,
.PreventDuplicates = PreventDuplicates,
.DataSource = DataSource,
.SelectedValues = SelectedValues,
.StartPosition = FormStartPosition.Manual,
.Location = PointToScreen(New Point(Width, 0))
}
Return oForm
End Function
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
Public Shadows ReadOnly Property Properties As RepositoryItemLookupControl2
Get
Return TryCast(MyBase.Properties, RepositoryItemLookupControl2)
End Get
End Property
Public Overrides ReadOnly Property EditorTypeName As String
Get
Return RepositoryItemLookupControl2.CustomEditName
End Get
End Property
Private Sub InitializeComponent()
Me.fProperties = New DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit()
Me.fPropertiesView = New DevExpress.XtraGrid.Views.Grid.GridView()
CType(Me.fProperties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.fPropertiesView, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'fProperties
'
Me.fProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.fProperties.Name = "fProperties"
Me.fProperties.PopupView = Me.fPropertiesView
'
'fPropertiesView
'
Me.fPropertiesView.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus
Me.fPropertiesView.Name = "fPropertiesView"
Me.fPropertiesView.OptionsSelection.EnableAppearanceFocusedCell = False
Me.fPropertiesView.OptionsView.ShowGroupPanel = False
CType(Me.fProperties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.fPropertiesView, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
End Class
<UserRepositoryItem("RegisterLookupControl2")>
Public Class RepositoryItemLookupControl2
Inherits RepositoryItemGridLookUpEdit
Shared Sub New()
RegisterLookupControl2()
End Sub
Public Const CustomEditName As String = "LookupControl2"
Public Overrides ReadOnly Property EditorTypeName As String
Get
Return CustomEditName
End Get
End Property
Public Shared Sub RegisterLookupControl2()
Dim img As Image = Nothing
EditorRegistrationInfo.Default.Editors.Add(
New EditorClassInfo(
CustomEditName,
GetType(LookupControl2),
GetType(RepositoryItemLookupControl2),
GetType(GridLookUpEditBaseViewInfo),
New ButtonEditPainter(),
True,
img,
GetType(ButtonEditAccessible)
)
)
End Sub
Public Overrides Sub Assign(item As RepositoryItem)
BeginUpdate()
Try
MyBase.Assign(item)
Dim source As RepositoryItemLookupControl2 = TryCast(item, RepositoryItemLookupControl2)
If source Is Nothing Then
Return
End If
Finally
EndUpdate()
End Try
End Sub
End Class

View File

@ -47,6 +47,7 @@ Public Class RepositoryItemLookupControl3
Public Sub New()
SetDropdownButtonEnabled(_MultiSelect)
End Sub
Private Const NAME_DATATABLE_INTERNAL = "__INTERNAL_DATATABLE__"
@ -114,6 +115,8 @@ Public Class RepositoryItemLookupControl3
GetType(ButtonEditAccessible)
)
EditorRegistrationInfo.Default.Editors.Add(oClassInfo)
End Sub
Private Sub SetFormButtonEnabled(pVisible As Boolean)

View File

@ -1,21 +0,0 @@
Imports System.Windows.Forms
Imports DevExpress.XtraGrid.Views.Grid
Namespace LookupGrid
Public Class LookupGridHandler
Inherits Handler.GridHandler
Public Sub New(ByVal gridView As GridView)
MyBase.New(gridView)
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
MyBase.OnKeyDown(e)
If e.KeyData = Keys.Delete AndAlso View.State = GridState.Normal Then
View.DeleteRow(View.FocusedRowHandle)
End If
End Sub
End Class
End Namespace

View File

@ -0,0 +1,24 @@
Imports DevExpress.XtraEditors.Controls
Public Class LookupGridLocalizer
Inherits EditResLocalizer
Private Const LANG_DE = "de-DE"
Public Overrides Function GetLocalizedString(id As StringId) As String
Dim oResult As String
Select Case id
Case StringId.LookUpEditValueIsNull
If Language = LANG_DE Then
oResult = "[Kein Wert ausgewählt]"
Else
oResult = "[No Value selected]"
End If
Case Else
oResult = MyBase.GetLocalizedString(id)
End Select
Return oResult
End Function
End Class

View File

@ -1,26 +0,0 @@
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Base.Handler
Imports DevExpress.XtraGrid.Registrator
Namespace LookupGrid
Public Class LookupGridViewInfoRegistrator
Inherits GridInfoRegistrator
Public Overrides ReadOnly Property ViewName() As String
Get
Return "GridView"
End Get
End Property
Public Overrides Function CreateView(ByVal grid As GridControl) As BaseView
Return New LookupGridView(TryCast(grid, GridControl))
End Function
Public Overrides Function CreateHandler(ByVal view As BaseView) As BaseViewHandler
Return New LookupGridHandler(TryCast(view, LookupGridView))
End Function
End Class
End Namespace

View File

@ -1,47 +0,0 @@
Partial Class LookupGridView
Inherits System.ComponentModel.Component
<System.Diagnostics.DebuggerNonUserCode()>
Public Sub New(ByVal container As System.ComponentModel.IContainer)
MyClass.New()
'Erforderlich für die Unterstützung des Windows.Forms-Klassenkompositions-Designers
If (container IsNot Nothing) Then
container.Add(Me)
End If
End Sub
<System.Diagnostics.DebuggerNonUserCode()>
Public Sub New()
MyBase.New()
'Dieser Aufruf ist für den Komponenten-Designer erforderlich.
InitializeComponent()
End Sub
'Die Komponente überschreibt den Löschvorgang zum Bereinigen der Komponentenliste.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Komponenten-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich.
'Das Bearbeiten ist mit dem Komponenten-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
End Class

View File

@ -1,56 +0,0 @@
Imports DevExpress.Data.Helpers
Imports DevExpress.Data.Filtering
Imports DevExpress.XtraGrid.Views.Base
Imports System.Reflection
Namespace LookupGrid
Public Class LookupGridView
Inherits DevExpress.XtraGrid.Views.Grid.GridView
Private _simpleSearch As Boolean
Public Sub New()
Me.New(Nothing)
End Sub
Public Property SimpleSearch() As Boolean
Get
Return _simpleSearch
End Get
Set(ByVal value As Boolean)
_simpleSearch = value
End Set
End Property
Public Sub New(ByVal grid As DevExpress.XtraGrid.GridControl)
MyBase.New(grid)
' put your initialization code here
End Sub
Protected Overrides ReadOnly Property ViewName() As String
Get
Return "LookupGridView"
End Get
End Property
Protected Overrides Function ConvertGridFilterToDataFilter(ByVal criteria As CriteriaOperator) As CriteriaOperator
Dim originalFindFilterText As String = Convert.ToString(GetType(ColumnView).InvokeMember("findFilterText", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.GetField, Nothing, Me, New Object() {}))
If SimpleSearch Then
If Not (String.IsNullOrEmpty(originalFindFilterText)) Then
GetType(ColumnView).InvokeMember("findFilterText", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.SetField, Nothing, Me, New Object() {String.Concat("""", originalFindFilterText, """")})
End If
Dim findCriteria As CriteriaOperator = Nothing
Dim _lastParserResults As FindSearchParserResults = Nothing
If Not (String.IsNullOrEmpty(FindFilterText)) Then
_lastParserResults = (New FindSearchParser()).Parse(FindFilterText, GetFindToColumnsCollection())
GetType(ColumnView).GetField("lastParserResults", BindingFlags.NonPublic Or BindingFlags.Instance).SetValue(Me, _lastParserResults)
If Not IsServerMode Then
_lastParserResults.AppendColumnFieldPrefixes()
End If
findCriteria = DxFtsContainsHelperAlt.Create(_lastParserResults, FilterCondition.Contains, IsServerMode)
End If
GetType(ColumnView).InvokeMember("findFilterText", BindingFlags.Instance Or BindingFlags.NonPublic Or BindingFlags.SetField, Nothing, Me, New Object() {originalFindFilterText})
Return criteria And findCriteria
End If
Return MyBase.ConvertGridFilterToDataFilter(criteria)
End Function
End Class
End Namespace