Reconfigure for GIT
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
Partial Class UserViewVariantsController
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Sub New(ByVal Container As System.ComponentModel.IContainer)
|
||||
MyClass.New()
|
||||
|
||||
'Required for Windows.Forms Class Composition Designer support
|
||||
Container.Add(Me)
|
||||
|
||||
End Sub
|
||||
|
||||
'Required by the Component Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Component Designer
|
||||
'It can be modified using the Component Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,180 @@
|
||||
Imports DevExpress.ExpressApp
|
||||
|
||||
Public Class UserViewVariantsController
|
||||
Inherits ViewController
|
||||
'Private Const STR_HasViewVariants_EnabledKey As String = "HasViewVariants"
|
||||
'Private Const STR_IsRootViewVariant_EnabledKey As String = "IsRootViewVariant"
|
||||
'Private Const STR_NewViewVariant_Id As String = "NewViewVariant"
|
||||
'Private Const STR_DeleteViewVariant_Id As String = "DeleteViewVariant"
|
||||
'Private Const STR_EditViewVariant_Id As String = "EditViewVariant"
|
||||
'Private Const STR_UserViewVariants_Image As String = "Action_Copy"
|
||||
'Private Const STR_NewViewVariant_Image As String = "Action_New"
|
||||
'Private Const STR_DeleteViewVariant_Image As String = "Action_Delete"
|
||||
'Private Const STR_EditViewVariant_Image As String = "Action_Edit"
|
||||
'Private Const STR_UserViewVariants_Id As String = "UserViewVariants"
|
||||
|
||||
'Private ReadOnly userViewVariantsCore As SingleChoiceAction
|
||||
''Protected changeVariantMainWindowController As ChangeVariantMainWindowController
|
||||
'Protected changeVariantController As ChangeVariantController
|
||||
'Protected rootModelViewVariants As IModelList(Of IModelVariant)
|
||||
'Private modelViews As IModelList(Of IModelView)
|
||||
|
||||
Public Sub New()
|
||||
'userViewVariantsCore = New SingleChoiceAction(Me, STR_UserViewVariants_Id, PredefinedCategory.View) With {.ImageName = STR_UserViewVariants_Image, .PaintStyle = ActionItemPaintStyle.CaptionAndImage, .Caption = CaptionHelper.ConvertCompoundName(STR_UserViewVariants_Id), .ItemType = SingleChoiceActionItemType.ItemIsOperation, .ShowItemsOnClick = True}
|
||||
'Dim addViewVariantItem As New ChoiceActionItem(STR_NewViewVariant_Id, CaptionHelper.ConvertCompoundName(STR_NewViewVariant_Id), STR_NewViewVariant_Id) With {.ImageName = STR_NewViewVariant_Image}
|
||||
'Dim removeViewVariantItem As New ChoiceActionItem(STR_DeleteViewVariant_Id, CaptionHelper.ConvertCompoundName(STR_DeleteViewVariant_Id), STR_DeleteViewVariant_Id) With {.ImageName = STR_DeleteViewVariant_Image}
|
||||
'Dim editViewVariantItem As New ChoiceActionItem(STR_EditViewVariant_Id, CaptionHelper.ConvertCompoundName(STR_EditViewVariant_Id), STR_EditViewVariant_Id) With {.ImageName = STR_EditViewVariant_Image}
|
||||
'userViewVariantsCore.Items.Add(addViewVariantItem)
|
||||
'userViewVariantsCore.Items.Add(editViewVariantItem)
|
||||
'userViewVariantsCore.Items.Add(removeViewVariantItem)
|
||||
'AddHandler userViewVariantsCore.Execute, AddressOf UserViewVariants_Execute
|
||||
End Sub
|
||||
' Private Sub UserViewVariants_Execute(ByVal sender As Object, ByVal e As SingleChoiceActionExecuteEventArgs)
|
||||
' UserViewVariants(e)
|
||||
' End Sub
|
||||
' Protected Overridable Sub UserViewVariants(ByVal e As SingleChoiceActionExecuteEventArgs)
|
||||
' Dim data As String = Convert.ToString(e.SelectedChoiceActionItem.Data)
|
||||
' If data = STR_NewViewVariant_Id OrElse data = STR_EditViewVariant_Id Then
|
||||
' ShowViewVariantParameterDialog(e, data)
|
||||
' ElseIf data = STR_DeleteViewVariant_Id Then
|
||||
' DeleteViewVariant()
|
||||
' End If
|
||||
' End Sub
|
||||
' Protected Overloads Overrides Sub OnActivated()
|
||||
' MyBase.OnActivated()
|
||||
' 'Initialize()
|
||||
' 'UpdateUserViewVariantsAction()
|
||||
' End Sub
|
||||
' Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
' 'If disposing Then
|
||||
' ' UnsubscribeFromEvents()
|
||||
' 'End If
|
||||
' MyBase.Dispose(disposing)
|
||||
' End Sub
|
||||
' Private Sub UnsubscribeFromEvents()
|
||||
' RemoveHandler userViewVariantsCore.Execute, AddressOf UserViewVariants_Execute
|
||||
' If changeVariantController IsNot Nothing AndAlso changeVariantController.ChangeVariantAction IsNot Nothing Then
|
||||
' RemoveHandler changeVariantController.ChangeVariantAction.Execute, AddressOf ChangeVariantAction_Executed
|
||||
' End If
|
||||
' End Sub
|
||||
' Private Sub Initialize()
|
||||
' changeVariantMainWindowController = Frame.GetController(Of ChangeVariantMainWindowController)()
|
||||
' changeVariantController = Frame.GetController(Of ChangeVariantController)()
|
||||
' AddHandler changeVariantController.ChangeVariantAction.Executed, AddressOf ChangeVariantAction_Executed
|
||||
' modelViews = CType(View.Model.Application.Views, IModelList(Of IModelView))
|
||||
' rootModelViewVariants = CType((CType(modelViews(GetRootViewId()), IModelViewVariants)).Variants, IModelList(Of IModelVariant))
|
||||
' End Sub
|
||||
' Private Sub ChangeVariantAction_Executed(ByVal sender As Object, ByVal e As ActionBaseEventArgs)
|
||||
' UpdateUserViewVariantsAction()
|
||||
' End Sub
|
||||
' Private Function GetRootViewId() As String
|
||||
' Dim variantsInfo As VariantsInfo = changeVariantMainWindowController.GetVariants(View)
|
||||
' Return If(variantsInfo IsNot Nothing, variantsInfo.RootViewId, View.Id)
|
||||
' End Function
|
||||
' Protected Overridable Sub ShowViewVariantParameterDialog(ByVal e As SingleChoiceActionExecuteEventArgs, ByVal mode As String)
|
||||
' Dim viewCaption As String = String.Empty
|
||||
' Dim parameter As New ViewVariantParameterObject(rootModelViewVariants)
|
||||
' If mode = STR_NewViewVariant_Id Then
|
||||
' parameter.Caption = String.Format("{0}_{1:g}", View.Caption, DateTime.Now)
|
||||
' viewCaption = CaptionHelper.GetLocalizedText("Texts", "NewViewVariantParameterCaption")
|
||||
' End If
|
||||
' If mode = STR_EditViewVariant_Id AndAlso changeVariantController.ChangeVariantAction.SelectedItem IsNot Nothing Then
|
||||
' parameter.Caption = changeVariantController.ChangeVariantAction.SelectedItem.Caption
|
||||
' viewCaption = CaptionHelper.GetLocalizedText("Texts", "EditViewVariantParameterCaption")
|
||||
' End If
|
||||
' Dim dialogController As DialogController = Application.CreateController(Of DialogController)()
|
||||
' AddHandler dialogController.Accepting, AddressOf dialogController_Accepting
|
||||
' dialogController.Tag = mode
|
||||
' Dim dv As DetailView = Application.CreateDetailView(ObjectSpaceInMemory.CreateNew(), parameter, False)
|
||||
' dv.ViewEditMode = ViewEditMode.Edit
|
||||
' dv.Caption = viewCaption
|
||||
' e.ShowViewParameters.CreatedView = dv
|
||||
' e.ShowViewParameters.Controllers.Add(dialogController)
|
||||
' e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow
|
||||
' End Sub
|
||||
' Protected Sub dialogController_Accepting(ByVal sender As Object, ByVal e As DialogControllerAcceptingEventArgs)
|
||||
' Dim dialogController As DialogController = CType(sender, DialogController)
|
||||
' RemoveHandler dialogController.Accepting, AddressOf dialogController_Accepting
|
||||
' Dim data As String = Convert.ToString(dialogController.Tag)
|
||||
' Dim parameter As ViewVariantParameterObject = TryCast(dialogController.Window.View.CurrentObject, ViewVariantParameterObject)
|
||||
' If data = STR_NewViewVariant_Id Then
|
||||
' NewViewVariant(parameter)
|
||||
' ElseIf data = STR_EditViewVariant_Id Then
|
||||
' EditViewVariant(parameter)
|
||||
' End If
|
||||
' End Sub
|
||||
' Protected Overridable Sub NewViewVariant(ByVal parameter As ViewVariantParameterObject)
|
||||
' 'It is necessary to save the current View settings into the application model before copying them.
|
||||
' View.SynchronizeInfo()
|
||||
' 'Identifier of a new view variant will be based on the identifier of the root view variant.
|
||||
' Dim newViewVariantId As String = String.Format("{0}_{1}", GetRootViewId(), Guid.NewGuid())
|
||||
' ' Adds a new child node of the IModelVariant type with a specific identifier to the parent IModelViewVariants node.
|
||||
' Dim newModelViewVariant As IModelVariant = (CType(rootModelViewVariants, ModelNode)).AddNode(Of IModelVariant)(newViewVariantId)
|
||||
' ' Creates a new node of the IModelView type by cloning the settings of the current View and then sets the clone to the View property of the view variant created above.
|
||||
' newModelViewVariant.View = TryCast((CType(modelViews, ModelNode)).AddClonedNode(CType(View.Model, ModelNode), newViewVariantId), IModelView)
|
||||
' 'Sets the Caption property of the view variant created above to the caption specified by an end-user in the dialog.
|
||||
' newModelViewVariant.Caption = parameter.Caption
|
||||
' 'It is necessary to add a default view variant node for the current View for correct operation of the Change Variant Action.
|
||||
' If rootModelViewVariants.Count = 1 Then
|
||||
' Dim currentModelViewVariant As IModelVariant = (CType(rootModelViewVariants, ModelNode)).AddNode(Of IModelVariant)(View.Id)
|
||||
' currentModelViewVariant.Caption = CaptionHelper.GetLocalizedText("Texts", "DefaultViewVariantCaption")
|
||||
' currentModelViewVariant.View = View.Model
|
||||
' End If
|
||||
' 'Updates the Change Variant Action structure based on the model customizations above.
|
||||
' changeVariantController.RefreshVariantsAction()
|
||||
' 'Sets the current view variant to the newly created one.
|
||||
' UpdateCurrentViewVariant(True)
|
||||
' 'Updates the items of our User View Variant Action based on the current the Change Variant Action structure.
|
||||
' UpdateUserViewVariantsAction()
|
||||
' End Sub
|
||||
' 'This method does almost the same work as NewViewVariant, but in reverse order.
|
||||
' Protected Overridable Sub DeleteViewVariant()
|
||||
' Dim variantsInfo As VariantsInfo = GetVariantsInfo()
|
||||
' 'You should not be able to remove the root view variant.
|
||||
' If variantsInfo IsNot Nothing AndAlso variantsInfo.CurrentVariantId <> GetRootViewId() Then
|
||||
' UpdateCurrentViewVariant(False)
|
||||
' rootModelViewVariants.Remove(rootModelViewVariants(variantsInfo.CurrentVariantId))
|
||||
' modelViews.Remove(modelViews(variantsInfo.CurrentVariantId))
|
||||
' changeVariantController.RefreshVariantsAction()
|
||||
' UpdateUserViewVariantsAction()
|
||||
' End If
|
||||
' If rootModelViewVariants.Count = 1 Then
|
||||
' CType(rootModelViewVariants, ModelNode).Undo()
|
||||
' End If
|
||||
' End Sub
|
||||
' Protected Overridable Sub EditViewVariant(ByVal parameter As ViewVariantParameterObject)
|
||||
' Dim variantsInfo As VariantsInfo = GetVariantsInfo()
|
||||
' If variantsInfo IsNot Nothing Then
|
||||
' rootModelViewVariants(variantsInfo.CurrentVariantId).Caption = parameter.Caption
|
||||
' End If
|
||||
' changeVariantController.RefreshVariantsAction()
|
||||
' End Sub
|
||||
' Private Sub UpdateCurrentViewVariant(ByVal isNew As Boolean)
|
||||
' Dim action As SingleChoiceAction = changeVariantController.ChangeVariantAction
|
||||
' If (Not isNew) AndAlso action.Items.Count > 1 Then
|
||||
' action.DoExecute(action.Items(action.Items.Count - 2))
|
||||
' End If
|
||||
' If isNew AndAlso action.Items.Count > 0 Then
|
||||
' action.DoExecute(action.Items(action.Items.Count - 1))
|
||||
' End If
|
||||
' End Sub
|
||||
' Private Sub UpdateUserViewVariantsAction()
|
||||
' Dim hasViewVariants As Boolean = changeVariantController.ChangeVariantAction.Items.Count > 0
|
||||
' UserViewVarintsAction.Items.FindItemByID(STR_EditViewVariant_Id).Enabled(STR_HasViewVariants_EnabledKey) = hasViewVariants
|
||||
' UserViewVarintsAction.Items.FindItemByID(STR_DeleteViewVariant_Id).Enabled(STR_HasViewVariants_EnabledKey) =
|
||||
'UserViewVarintsAction.Items.FindItemByID(STR_EditViewVariant_Id).Enabled(STR_HasViewVariants_EnabledKey)
|
||||
|
||||
' If changeVariantController.ChangeVariantAction.SelectedItem IsNot Nothing Then
|
||||
' Dim variantInfo As VariantInfo = CType(changeVariantController.ChangeVariantAction.SelectedItem.Data, VariantInfo)
|
||||
' UserViewVarintsAction.Items.FindItemByID(STR_DeleteViewVariant_Id).Enabled(STR_IsRootViewVariant_EnabledKey) = variantInfo.ViewID <> GetRootViewId()
|
||||
' End If
|
||||
' End Sub
|
||||
' Private Function GetVariantsInfo() As VariantsInfo
|
||||
' Return changeVariantMainWindowController.GetVariants(GetRootViewId())
|
||||
' End Function
|
||||
' Public ReadOnly Property UserViewVarintsAction() As SingleChoiceAction
|
||||
' Get
|
||||
' Return userViewVariantsCore
|
||||
' End Get
|
||||
' End Property
|
||||
End Class
|
||||
@@ -0,0 +1,40 @@
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports System
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.ExpressApp.DC
|
||||
Imports DevExpress.ExpressApp.Model
|
||||
Imports DevExpress.Persistent.Validation
|
||||
Imports DevExpress.ExpressApp.ViewVariantsModule
|
||||
|
||||
|
||||
<DomainComponent(), DefaultProperty("Caption")> _
|
||||
Public Class ViewVariantParameterObject
|
||||
Private ReadOnly variants As IModelList(Of IModelVariant)
|
||||
Public Sub New(ByVal variants As IModelList(Of IModelVariant))
|
||||
Me.variants = variants
|
||||
End Sub
|
||||
<RuleFromBoolProperty("RuleFromBoolProperty_ViewVariantParameterObject.IsUniqueCaption", "AddViewVariantContext", UsedProperties:="Caption", CustomMessageTemplate:="You must specify a different value, because there is already a view variant with the same caption."), Browsable(False)> _
|
||||
Public ReadOnly Property IsUniqueCaption() As Boolean
|
||||
Get
|
||||
Dim ok As Boolean = True
|
||||
For Each [variant] As IModelVariant In variants
|
||||
If [variant].Caption = Caption Then
|
||||
ok = False
|
||||
Exit For
|
||||
End If
|
||||
Next [variant]
|
||||
Return ok
|
||||
End Get
|
||||
End Property
|
||||
Private privateCaption As String
|
||||
<RuleRequiredField("RuleRequiredField_ViewVariantParameterObject.Caption", "AddViewVariantContext")> _
|
||||
Public Property Caption() As String
|
||||
Get
|
||||
Return privateCaption
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
privateCaption = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user