Beispiel #1
0
 public static TWindow CreateExternalWindow <TWindow>(Func <TWindow> instanceCreator, string className,
                                                      bool takeOwnership      = true,
                                                      string text             = null, WindowStyles?styles = null,
                                                      WindowExStyles?exStyles = null, int?x               = null, int?y          = null,
                                                      int?width        = null, int?height                 = null, IntPtr?hParent = null, IntPtr?hMenu = null,
                                                      IntPtr?hInstance = null, IntPtr?extraParams         = null, uint?controlStyles = null,
                                                      IConstructionParams constructionParams = null)
     where TWindow : WindowCore
 {
     if (string.IsNullOrWhiteSpace(className))
     {
         throw new ArgumentException("className is not valid");
     }
     if (constructionParams == null)
     {
         constructionParams = new ConstructionParams();
     }
     return(CreateExternalWindowCore(
                instanceCreator,
                takeOwnership,
                className,
                text,
                styles ?? constructionParams.Styles,
                exStyles ?? constructionParams.ExStyles,
                x ?? constructionParams.X,
                y ?? constructionParams.Y,
                width ?? constructionParams.Width,
                height ?? constructionParams.Height,
                hParent ?? constructionParams.ParentHandle,
                hMenu ?? constructionParams.MenuHandle,
                hInstance ?? Cache.Instance.ProcessHandle,
                extraParams ?? IntPtr.Zero,
                controlStyles ?? constructionParams.ControlStyles));
 }
Beispiel #2
0
 private TWindow CreateWindowInnerCore <TWindow>(TWindow instance,
                                                 string text, WindowStyles?styles,
                                                 WindowExStyles?exStyles, int?x, int?y,
                                                 int?width, int?height, IntPtr?hParent, IntPtr?hMenu, uint?controlStyles,
                                                 IConstructionParams constructionParams)
     where TWindow : WindowCore
 {
     if (constructionParams == null)
     {
         constructionParams = new ConstructionParams();
     }
     return(this.CreateWindowCoreFromInstance(instance,
                                              text,
                                              styles ?? constructionParams.Styles,
                                              exStyles ?? constructionParams.ExStyles,
                                              x ?? constructionParams.X,
                                              y ?? constructionParams.Y,
                                              width ?? constructionParams.Width,
                                              height ?? constructionParams.Height,
                                              hParent ?? constructionParams.ParentHandle,
                                              hMenu ?? constructionParams.MenuHandle,
                                              controlStyles ?? constructionParams.ControlStyles));
 }