Ejemplo n.º 1
0
        public DrawerControl CreateAndRunDrawerInStandaloneForm(VideoModes videoMode, DrawerSettings drawerSettings, Func <Form> formFactory)
        {
            FormDrawer    drawer        = CreateDrawer(videoMode, drawerSettings);
            DrawerControl drawerControl = null;
            var           localsync     = new ManualResetEventSlim();
            var           t             = new Thread(() =>
            {
                var form      = formFactory();
                drawerControl = new DrawerControl(drawer)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom
                };
                form.Controls.Add(drawerControl);
                form.Shown += (o, e) => localsync.Set();
                Application.Run(form);
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            localsync.Wait();
            if (drawer != null)
            {
                drawer.WaitForInitialization();
            }
            return(drawerControl);
        }
Ejemplo n.º 2
0
 public DrawerControl(FormDrawer drawer)
     : this()
 {
     Drawer = drawer;
 }
Ejemplo n.º 3
0
		public DrawerControl(FormDrawer drawer)
			: this()
		{
			Drawer = drawer;
		}