ZooFlow: Use BaseRibbonForm, deprecate frmAdmin_Base
This commit is contained in:
@@ -8,9 +8,6 @@ Namespace Base
|
||||
Private _Logger As Logger
|
||||
Private _Form As Form
|
||||
|
||||
Private Const UNKNOWN_METHOD = "Unknown Method"
|
||||
Private Const UNKNOWN_FORM = "Unknown Form"
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Logger As Logger, Form As Form)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = Logger
|
||||
@@ -28,9 +25,7 @@ Namespace Base
|
||||
End Sub
|
||||
|
||||
Private Function GetMessage(Exception As Exception) As String
|
||||
Dim oTargetSite = Exception.TargetSite
|
||||
Dim oMethodName = GetMethodName(Exception)
|
||||
Dim oFormName = GetFormName(Exception)
|
||||
Dim oCallingClass = LogConfig.GetClassFullName(IncludeMethodNames:=True, Parts:=2)
|
||||
Dim oMessage As String = String.Empty
|
||||
|
||||
If TypeOf Exception Is SqlClient.SqlException Then
|
||||
@@ -42,7 +37,7 @@ Namespace Base
|
||||
ElseIf TypeOf Exception Is NoNullAllowedException Then
|
||||
oMessage = "Einige benötigte Felder wurde nicht ausgefüllt."
|
||||
Else
|
||||
oMessage = $"Es ist ein unerwarteter Fehler in {oFormName}/{oMethodName} aufgetreten. Mehr Informationen finden Sie im Log."
|
||||
oMessage = $"Es ist ein unerwarteter Fehler in {oCallingClass} aufgetreten. Mehr Informationen finden Sie im Log."
|
||||
End If
|
||||
|
||||
If _LogConfig.Debug Then
|
||||
@@ -55,49 +50,6 @@ Namespace Base
|
||||
|
||||
Return oMessage
|
||||
End Function
|
||||
|
||||
'Private Function GetMessage(Exception As Exception) As String
|
||||
' Dim oTargetSite = Exception.TargetSite
|
||||
' Dim oMethodName = GetMethodName(Exception)
|
||||
' Dim oFormName = GetFormName(Exception)
|
||||
' Dim oMessage As String = String.Empty
|
||||
|
||||
' oMessage &= $"Form: {oFormName}{vbNewLine}"
|
||||
' oMessage &= $"Method: {oMethodName}{vbNewLine}"
|
||||
|
||||
' If Not String.IsNullOrEmpty(Exception.StackTrace) Then
|
||||
' oMessage &= $"Message: {Exception.Message}{vbNewLine}{vbNewLine}"
|
||||
' End If
|
||||
|
||||
' If Not String.IsNullOrEmpty(Exception.StackTrace) Then
|
||||
' oMessage &= $"Stacktrace: {Exception.StackTrace}{vbNewLine}"
|
||||
' End If
|
||||
|
||||
' oMessage &= $"{vbNewLine}"
|
||||
' oMessage &= $"Please report this error to error@digitaldata.works"
|
||||
|
||||
' Return oMessage
|
||||
'End Function
|
||||
|
||||
Private Function GetMethodName(Exception As Exception) As String
|
||||
Dim oMethodName = Exception.TargetSite?.Name
|
||||
|
||||
If oMethodName Is Nothing Then
|
||||
Return UNKNOWN_METHOD
|
||||
Else
|
||||
Return oMethodName
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function GetFormName(Exception As Exception) As String
|
||||
Dim oFormName = Exception.TargetSite?.ReflectedType?.Name
|
||||
|
||||
If oFormName Is Nothing Then
|
||||
Return UNKNOWN_FORM
|
||||
Else
|
||||
Return oFormName
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
@@ -1,227 +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>{D20A6BF2-C7C6-4A7A-B34D-FA27D775A049}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DigitalData.GUIs.Common</RootNamespace>
|
||||
<AssemblyName>DigitalData.GUIs.Common</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.GUIs.Common.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.GUIs.Common.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" />
|
||||
<Reference Include="DevExpress.Dialogs.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Printing.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Utils.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraDialogs.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<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" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraTreeList.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DigitalData.Controls.DocumentViewer">
|
||||
<HintPath>..\Controls.DocumentViewer\bin\Debug\DigitalData.Controls.DocumentViewer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GdPicture.NET.14">
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.6.8\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<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="Base\BaseErrorHandler.vb" />
|
||||
<Compile Include="Base\BaseRibbonForm.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="DataResultList\DataResultConfig.vb" />
|
||||
<Compile Include="DataResultList\DataResultParams.vb" />
|
||||
<Compile Include="DataResultList\frmDataResultList.Designer.vb">
|
||||
<DependentUpon>frmDataResultList.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DataResultList\frmDataResultList.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocumentResultList\DocumentResultConfig.vb" />
|
||||
<Compile Include="DocumentResultList\DocumentResultParams.vb" />
|
||||
<Compile Include="DocumentResultList\frmDocumentResultList.Designer.vb">
|
||||
<DependentUpon>frmDocumentResultList.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DocumentResultList\frmDocumentResultList.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="IResultForm.vb" />
|
||||
<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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="DataResultList\frmDataResultList.resx">
|
||||
<DependentUpon>frmDataResultList.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DocumentResultList\frmDocumentResultList.resx">
|
||||
<DependentUpon>frmDocumentResultList.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>
|
||||
<ProjectReference Include="..\Modules.Config\Config.vbproj">
|
||||
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Database\Database.vbproj">
|
||||
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
|
||||
<Name>Database</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Language\Language.vbproj">
|
||||
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
|
||||
<Name>Language</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Logging\Logging.vbproj">
|
||||
<Project>{903B2D7D-3B80-4BE9-8713-7447B704E1B0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.ZooFlow\ZooFlow.vbproj">
|
||||
<Project>{81cac44f-3711-4c8f-ae98-e02a7448782a}</Project>
|
||||
<Name>ZooFlow</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\txt.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\pdf.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\doc.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\xls.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\ppt.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\dwg.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\dxf.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\tiff.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\jpg.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\_blank.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\_page.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\png.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Article_32x32.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Open_32x32.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\Copy_32x32.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -12,21 +12,45 @@ Public Class GridBuilder
|
||||
Views.AddRange(GridViews)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Applies common properties to all GridViews
|
||||
''' </summary>
|
||||
Public Function WithDefaults() As GridBuilder
|
||||
For Each oView In Views
|
||||
oView.OptionsView.EnableAppearanceEvenRow = True
|
||||
oView.OptionsView.ShowAutoFilterRow = True
|
||||
WithDefaults(oView)
|
||||
Next
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Applies common properties to the supplied GridView
|
||||
''' </summary>
|
||||
Public Function WithDefaults(GridView As GridView)
|
||||
GridView.OptionsView.EnableAppearanceEvenRow = True
|
||||
GridView.OptionsView.ShowAutoFilterRow = True
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Applies read-only properties to all GridViews
|
||||
''' </summary>
|
||||
Public Function WithReadOnlyOptions() As GridBuilder
|
||||
For Each oView In Views
|
||||
oView.OptionsBehavior.Editable = False
|
||||
oView.OptionsBehavior.ReadOnly = True
|
||||
WithReadOnlyOptions(oView)
|
||||
Next
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Applies read-only properties to the supplied GridView
|
||||
''' </summary>
|
||||
Public Function WithReadOnlyOptions(GridView As GridView) As GridBuilder
|
||||
GridView.OptionsBehavior.Editable = False
|
||||
GridView.OptionsBehavior.ReadOnly = True
|
||||
|
||||
Return Me
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user