MS Optimizing, CurrentLocal
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.EDMI.API
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Logging.LogConfig
|
||||
|
||||
@@ -12,33 +13,63 @@ Namespace My
|
||||
Partial Friend Class MyApplication
|
||||
Private _Logger As Logger
|
||||
|
||||
Private _BaseUserConfigPath As String = Windows.Forms.Application.UserAppDataPath
|
||||
Private oUserAppDataPath As String = Windows.Forms.Application.UserAppDataPath
|
||||
Private _BaseLocalUserConfigPath As String = Windows.Forms.Application.LocalUserAppDataPath
|
||||
Private _BaseMachineConfigPath As String = Windows.Forms.Application.CommonAppDataPath
|
||||
Private _BaseStartupPath As String = Windows.Forms.Application.StartupPath
|
||||
Private oCommonAppDataPath As String = Windows.Forms.Application.CommonAppDataPath
|
||||
Private oStartupPath As String = Windows.Forms.Application.StartupPath
|
||||
|
||||
Public Sub App_Startup() Handles Me.Startup
|
||||
Dim oLogConfig As New LogConfig(LogPath:=PathType.AppData, CompanyName:="Digital Data", ProductName:="ZooFlow") With {.Debug = True}
|
||||
|
||||
If My.Settings.UseAppConfigConString = True Then
|
||||
' UserAppDataPath = StartupPath
|
||||
oCommonAppDataPath = oStartupPath
|
||||
End If
|
||||
' System Config files like Service Url will be saved in %LocalAppdata% so they will remain on the machine
|
||||
Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig,
|
||||
_BaseLocalUserConfigPath,
|
||||
_BaseMachineConfigPath,
|
||||
_BaseStartupPath)
|
||||
Dim oConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig,
|
||||
oUserAppDataPath,
|
||||
oCommonAppDataPath,
|
||||
oStartupPath)
|
||||
|
||||
' Layout files will be saved in %Appdata% (Roaming) so they will be syncronized with the user profile
|
||||
Dim oUIConfigPath = IO.Path.Combine(_BaseUserConfigPath, ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
Dim oUIConfigAlternatePath = IO.Path.Combine(_BaseStartupPath, ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
Dim oUIConfigPath = IO.Path.Combine(oUserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
Dim oUIConfigAlternatePath = IO.Path.Combine(oUserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
|
||||
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPath, oUIConfigPath, oUIConfigAlternatePath)
|
||||
|
||||
'If oConfigManager.Config.ConnectionStringAppServer <> String.Empty Then
|
||||
' MyConStringAppserv = DecryptConnectionString(oConfigManager.Config.ConnectionStringAppServer)
|
||||
' If InitAppDatabase() Then
|
||||
' Logger.Debug("ConnectionStringAppServer will be used")
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
LogConfig = oLogConfig
|
||||
LogConfig.Debug = True
|
||||
|
||||
SystemConfigManager = oSystemConfigManager
|
||||
SystemConfigManager = oConfigManager
|
||||
UIConfigManager = oUIConfigManager
|
||||
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Logger.Debug("Starting Client Suite..")
|
||||
_Logger.Debug("Starting ZooFlow...")
|
||||
|
||||
If oConfigManager.Config.AppServerConfig <> String.Empty Then
|
||||
Try
|
||||
Dim oSplit() As String = oConfigManager.Config.AppServerConfig.ToString.Split(":")
|
||||
Dim oAppServerAddress As String = oSplit(0)
|
||||
Dim oAppServerPort As Integer = 9000
|
||||
If oSplit.Length = 2 Then
|
||||
oAppServerPort = oSplit(1)
|
||||
End If
|
||||
_Client = New Client(LogConfig, oAppServerAddress, oAppServerPort)
|
||||
If Not IsNothing(_Client) Then
|
||||
If _Client.Connect() Then
|
||||
APPSERVER_ACTIVE = True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
_Logger.Warn($"Could not initialize the AppServer: {ex.Message}")
|
||||
End Try
|
||||
End If
|
||||
|
||||
Dim oCommandLineArgs As New ClassCommandlineArgs(LogConfig)
|
||||
Dim oArgs = Environment.GetCommandLineArgs().Skip(1).ToList()
|
||||
|
||||
Reference in New Issue
Block a user