Пример #1
0
 /// <summary>
 /// The constructor for Windows Forms application.
 /// </summary>
 /// <param name="form">The base form for the DBLangEngine to use.</param>
 /// <param name="appType">The application type. Should be AppType.Winforms.</param>
 public DBLangEngine(System.Windows.Forms.Form form, Misc.AppType appType) :
     base(form)
 {
     this.appType = appType;
     ThisForm     = form;
     // int the data dir with default
     dataDir = Paths.GetAppSettingsFolder(appType);
 }
Пример #2
0
 /// <summary>
 /// The constructor for Windows Presentation Foundation (WPF) application.
 /// </summary>
 /// <param name="window">The base window for the DBLangEngine to use.</param>
 /// <param name="appType">The application type. Should be AppType.WPF.</param>
 /// <param name="useUids">Whether to use x:Uid's to reference to a FrameworkElement class instance.</param>
 public DBLangEngine(System.Windows.Window window, Misc.AppType appType, bool useUids = true) :
     base(window, useUids)
 {
     this.appType = appType;
     this.useUids = useUids;
     ThisWindow   = window;
     // int the data dir with default
     dataDir = Paths.GetAppSettingsFolder(appType);
 }
Пример #3
0
 /// <summary>
 /// Get an assembly of the application depending of
 /// <para/>the application type (<paramref name="appType"/>).
 /// </summary>
 /// <param name="appType">The application type.</param>
 /// <returns>The assembly of the application.</returns>
 private static string GetAssemblyName(Misc.AppType appType)
 {
     if (appType == Misc.AppType.Winforms)
     {
         return(System.Windows.Forms.Application.ProductName);
     }
     else if (appType == Misc.AppType.WPF)
     {
         return(System.Windows.Application.ResourceAssembly.GetName().Name);
     }
     else
     {
         return(string.Empty);
     }
 }