Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            bool done = false;
            var  ss   = new Splash();

            System.Threading.ThreadPool.QueueUserWorkItem((x) =>
            {
                ss.Show();
                while (!done)
                {
                    Application.DoEvents();
                }
                ss.CloseForReal();
            });

            ComposeMefParts();

            //if (this.container == null)
            //{
            //  //TODO: error
            //  throw new Exception("Unable to find window container");
            //}

            if (this.windows == null)
            {
                log.Fatal("Unable to compose windows");
                Close();
                return;
            }

            this.eventManager.AddListener(this);

            foreach (var win in this.windows)
            {
                win.Attach(this.container);
            }

            if (this.toolItems == null)
            {
                log.Fatal("Unable to compose toolbar items");
                Close();
            }

            if (this.groupedToolItems == null)
            {
                log.Fatal("Unable to compose grouped toolbar items");
                Close();
            }


            AddRibbonItems();


            // Hack to enable splash screen to display
            //System.Threading.Thread.Sleep(2000);
            done = true;
        }
Exemplo n.º 2
0
        public ImportUi()
        {
            InitializeComponent();

            this.compContainer = new CompositionContainer(RVRMeander.Utils.Mef.GetMefCatalogs());

            this.container  = null;
            this.mapFactory = null;

            try
            {
                this.compContainer.ComposeParts(this);
            }
            catch (CompositionException ex)
            {
                log.Fatal(ex.ToString());
                Close();
            }

            if (this.container == null)
            {
                log.Error("Unable to find an IInteractiveWindowContainer");
            }

            if (this.mapFactory == null)
            {
                log.Error("Unable to find a IGisWindowFactory");
            }

            this.dataset = null;

            this.btnSaveDataset.Enabled = false;
        }