Files
EgtWPFLib/InitializeEgtWPFLib.vb

228 lines
7.7 KiB
VB.net

Public Class InitializeEgtWPFLib
#Region "Variabili direttori EgtWPFLib e Program"
' Dichiarazione variabili direttori
Private Const m_sEgtWPFLibDevDir As String = "c:/EgtDev/EgtWPFLib"
Private Const m_sEgtWPFLibResourcesDir As String = m_sEgtWPFLibDevDir & "/Resources"
Private Const m_sEgtWPFLibFontsDir As String = m_sEgtWPFLibResourcesDir & "/Fonts"
Private Const m_sEgtWPFLibMsgBoxDir As String = m_sEgtWPFLibResourcesDir & "/EgtMsgBox"
Private Shared m_sProgramDevDir As String = String.Empty
Private Shared m_sProgramResourcesDir As String = String.Empty
Private Shared m_sProgramFontsDir As String = String.Empty
Private Shared m_sProgramMsgBoxDir As String
Friend Shared ReadOnly Property ProgramDevDir As String
Get
Return m_sProgramDevDir
End Get
End Property
#End Region
#Region "Informazioni di base sul programma"
' Basic Info
Private Shared m_dDefaultResolutionWidth As Double
Private Shared m_dDefaultResolutionHeight As Double
Private Shared m_iBaseGridWidth As Integer
Private Shared m_iBaseGridHeight As Integer
Private Shared m_sFontFamilyName As String
Private Shared m_sFontFamilyFileName As String
Private Shared m_dUpperCaseFontSize As Double
Private Shared m_dLowerCaseFontSize As Double
Private Shared m_iResourceDictionary As Integer
Friend Shared ReadOnly Property BaseGridWidth As Integer
Get
Return m_iBaseGridWidth
End Get
End Property
Friend Shared ReadOnly Property BaseGridHeight As Integer
Get
Return m_iBaseGridHeight
End Get
End Property
Friend Shared ReadOnly Property FontFamilyName As String
Get
Return m_sFontFamilyName
End Get
End Property
Friend Shared ReadOnly Property FontFamilyFileName As String
Get
Return m_sFontFamilyFileName
End Get
End Property
Friend Shared Property ResourceDictionary As Integer
Get
Return m_iResourceDictionary
End Get
Set(value As Integer)
m_iResourceDictionary = value
End Set
End Property
Shared Sub EgtBasicInfo_Initialization(ProgramDevDir As String, DefaultResolutionWidth As Double, DefaultResolutionHeight As Double, BaseGridWidth As Integer, BaseGridHeight As Integer, FontFamilyName As String, FontFamilyFileName As String, UpperCaseFontSize As Double,
LowerCaseFontSize As Double)
m_sProgramDevDir = ProgramDevDir
m_dDefaultResolutionWidth = DefaultResolutionWidth
m_dDefaultResolutionHeight = DefaultResolutionHeight
m_iBaseGridWidth = BaseGridWidth
m_iBaseGridHeight = BaseGridHeight
m_sFontFamilyName = FontFamilyName
m_sFontFamilyFileName = FontFamilyFileName
m_dUpperCaseFontSize = UpperCaseFontSize
m_dLowerCaseFontSize = LowerCaseFontSize
End Sub
Shared Sub EgtBasicInfo_Initialization(ProgramDevDir As String, DefaultResolutionWidth As Double, DefaultResolutionHeight As Double, BaseGridWidth As Integer, BaseGridHeight As Integer, FontFamilyName As String, FontFamilyFileName As String, UpperCaseFontSize As Double,
LowerCaseFontSize As Double, ResourceDictionary As Integer)
m_sProgramDevDir = ProgramDevDir
m_dDefaultResolutionWidth = DefaultResolutionWidth
m_dDefaultResolutionHeight = DefaultResolutionHeight
m_iBaseGridWidth = BaseGridWidth
m_iBaseGridHeight = BaseGridHeight
m_sFontFamilyName = FontFamilyName
m_sFontFamilyFileName = FontFamilyFileName
m_dUpperCaseFontSize = UpperCaseFontSize
m_dLowerCaseFontSize = LowerCaseFontSize
m_iResourceDictionary = ResourceDictionary
End Sub
#End Region
#Region "EgtKeyboard received parameters"
'EgtKeyboard
Private Shared m_KeyboardButton As Style
Private Shared m_KeyboardBorder As Style
#End Region
#Region "EgtCalculator received parameters"
'EgtCalculator
Private Shared m_CalculatorButton As Style
Private Shared m_CalculatorBorder As Style
#End Region
#Region "EgtMsgBox received parameters"
'EgtMsgBox
Private Shared m_MsgBoxBorder As Style
Private Shared m_MsgBoxButton As Style
Private Shared m_MsgBoxProgressBar As Style
Private Shared m_dMsgBoxTitleFontsize As Double = 50
Private Shared m_dMsgBoxTextFontsize As Double = 30
Friend Shared ReadOnly Property MsgBoxButton As Style
Get
Return m_MsgBoxButton
End Get
End Property
Friend Shared ReadOnly Property MsgBoxBorder As Style
Get
Return m_MsgBoxBorder
End Get
End Property
Friend Shared ReadOnly Property MsgBoxTitleFontsize As Double
Get
Return m_dMsgBoxTitleFontsize
End Get
End Property
Friend Shared ReadOnly Property MsgBoxTextFontsize As Double
Get
Return m_dMsgBoxTextFontsize
End Get
End Property
Shared Sub EgtMsgBox_Initialization(MsgBoxBorder As Style, MsgBoxButton As Style, MsgBoxProgressBar As Style, MsgBoxTitleFontsize As Double, MsgBoxTextFontsize As Double)
m_MsgBoxBorder = MsgBoxBorder
m_MsgBoxButton = MsgBoxButton
m_MsgBoxProgressBar = MsgBoxProgressBar
m_dMsgBoxTitleFontsize = MsgBoxTitleFontsize
m_dMsgBoxTextFontsize = MsgBoxTextFontsize
End Sub
#End Region
#Region "EgtWPFLib Init"
Const sDangerIcon As String = "/Danger.png"
Const sExclamationIcon As String = "/Exclamation.png"
Const sImageIcon As String = "/Image.png"
Private Shared m_sMsgBoxDangerPath As String
Private Shared m_sMsgBoxExclamationPath As String
Private Shared m_sMsgBoxImagePath As String
Private Shared m_sFontFamilyPath As String
Friend Shared ReadOnly Property MsgBoxDangerPath As String
Get
Return m_sMsgBoxDangerPath
End Get
End Property
Friend Shared ReadOnly Property MsgBoxExclamationPath As String
Get
Return m_sMsgBoxExclamationPath
End Get
End Property
Friend Shared ReadOnly Property MsgBoxImagePath As String
Get
Return m_sMsgBoxImagePath
End Get
End Property
Friend Shared ReadOnly Property FontFamilyPath As String
Get
Return m_sFontFamilyPath
End Get
End Property
' Funzione che imposta i percorsi di tutte le risorse, prendendole dal programma corrente se disponibili, o altrimenti dalla libreria
Shared Sub EgtPaths_Initialization()
m_sProgramResourcesDir = m_sProgramDevDir & "/Resources"
m_sProgramFontsDir = m_sProgramResourcesDir & "/Fonts"
m_sProgramMsgBoxDir = m_sProgramResourcesDir & "/EgtMsgBox"
If System.IO.File.Exists(m_sProgramMsgBoxDir & sDangerIcon) Then
m_sMsgBoxDangerPath = m_sProgramMsgBoxDir & sDangerIcon
Else
m_sMsgBoxDangerPath = m_sEgtWPFLibMsgBoxDir & sDangerIcon
End If
If System.IO.File.Exists(m_sProgramMsgBoxDir & sExclamationIcon) Then
m_sMsgBoxExclamationPath = m_sProgramMsgBoxDir & sExclamationIcon
Else
m_sMsgBoxExclamationPath = m_sEgtWPFLibMsgBoxDir & sExclamationIcon
End If
If System.IO.File.Exists(m_sProgramMsgBoxDir & sImageIcon) Then
m_sMsgBoxImagePath = m_sProgramMsgBoxDir & sImageIcon
Else
m_sMsgBoxImagePath = m_sEgtWPFLibMsgBoxDir & sImageIcon
End If
Dim s As String = m_sProgramFontsDir & m_sFontFamilyFileName
If System.IO.File.Exists(s) Then
m_sFontFamilyPath = m_sProgramFontsDir & m_sFontFamilyName
Else
m_sFontFamilyPath = SystemFonts.CaptionFontFamily.Source
End If
End Sub
#End Region
End Class