示例#1
0
 public static void StartAsynchronously(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
 {
     Thread t = new Thread(delegate()
     {
         try
         {
             RegionManager manager = new RegionManager(killWindowOnRegionCreation, page, config, regionManagement);
             Application.Run(manager);
         }
         catch { }
     });
     t.SetApartmentState(ApartmentState.STA);
     t.Start();
 }
        public static void StartAsynchronously(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
        {
            Thread t = new Thread(delegate()
            {
                try
                {
                    RegionManager manager = new RegionManager(killWindowOnRegionCreation, page, config, regionManagement);
                    Application.Run(manager);
                }
                catch { }
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
        }
示例#3
0
 public static void StartSynchronously(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
 {
     bool done = false;
     Thread t = new Thread(delegate()
         {
             try
             {
                 RegionManager manager = new RegionManager(killWindowOnRegionCreation, page, config, regionManagement);
                 Application.Run(manager);
                 done = true;
             }
             catch { done = true; }
         });
     t.SetApartmentState(ApartmentState.STA);
     t.Start();
     while (!done)
         Thread.Sleep(100);
 }
示例#4
0
 public RegionManager(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement, RegionInfo startingRegionInfo)
 {
     _regionManager = regionManagement;
     _config = config;
     _startingRegionInfo = startingRegionInfo;
     RegionInfo = _startingRegionInfo;
     KillAfterRegionCreation = killWindowOnRegionCreation;
     _pageToStart = page;
     InitializeComponent();
     ChangeRegionInfo(_startingRegionInfo);
     if (_startingRegionInfo == null)
         groupBox5.Visible = false;
     tabControl1.SelectedIndex = (int)_pageToStart;
     changeEstateBox.Visible = false;
     _timer.Interval = 100;
     _timer.Tick += m_timer_Tick;
     _timer.Start ();
 }
        public static void StartSynchronously(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
        {
            bool   done = false;
            Thread t    = new Thread(delegate()
            {
                try
                {
                    RegionManager manager = new RegionManager(killWindowOnRegionCreation, page, config, regionManagement);
                    Application.Run(manager);
                    done = true;
                }
                catch { done = true; }
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            while (!done)
            {
                Thread.Sleep(100);
            }
        }
 public RegionManager(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
 {
     _regionManager          = regionManagement;
     _config                 = config;
     KillAfterRegionCreation = killWindowOnRegionCreation;
     _pageToStart            = page;
     InitializeComponent();
     if (page == RegionManagerPage.CreateRegion)
     {
         tabControl1.SelectedTab = tabPage2;
     }
     else if (page == RegionManagerPage.EstateSetup)
     {
         tabControl1.SelectedTab = tabPage3;
     }
     changeEstateBox.Visible    = false;
     CStartupType.SelectedIndex = 1;
     RefreshCurrentRegions();
     GetDefaultRegions();
     _timer.Interval = 100;
     _timer.Tick    += m_timer_Tick;
     _timer.Start();
 }
示例#7
0
 public RegionManager(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement)
 {
     _regionManager = regionManagement;
     _config = config;
     KillAfterRegionCreation = killWindowOnRegionCreation;
     _pageToStart = page;
     InitializeComponent();
     if (page == RegionManagerPage.CreateRegion)
         tabControl1.SelectedTab = tabPage2;
     else if (page == RegionManagerPage.EstateSetup)
         tabControl1.SelectedTab = tabPage3;
     changeEstateBox.Visible = false;
     CStartupType.SelectedIndex = 1;
     RefreshCurrentRegions();
     GetDefaultRegions ();
     _timer.Interval = 100;
     _timer.Tick += m_timer_Tick;
     _timer.Start ();
 }
示例#8
0
 public static RegionInfo StartSynchronously(bool killWindowOnRegionCreation, RegionManagerPage page, IConfigSource config, IRegionManagement regionManagement, RegionInfo startingRegionInfo)
 {
     RegionManager manager = null;
     bool done = false;
     Thread t = new Thread(delegate()
     {
         try
         {
             manager = new RegionManager(killWindowOnRegionCreation, page, config, regionManagement, startingRegionInfo);
             Application.Run(manager);
             done = true;
         }
         catch { done = true; }
     });
     t.SetApartmentState(ApartmentState.STA);
     t.Start();
     while (!done)
         Thread.Sleep(100);
     if (manager.RegionInfo == null)
     {
         MessageBox.Show("You did not create a region, try again (if you did, make sure you presed the Update button!)");
         return StartSynchronously(killWindowOnRegionCreation, page, config, regionManagement, startingRegionInfo);
     }
     return manager.RegionInfo;
 }