Ejemplo n.º 1
0
        protected virtual void Initialize(IPluginServiceProvider serviceProvider)
        {
            this.coreForm = serviceProvider.GetService(typeof(Form)) as Form;

            if (serviceProvider.Contains(typeof(IContainerControl)))
            {
                this.mdiUIContainer = serviceProvider.GetService(typeof(IContainerControl)) as Control;
            }

            this.currentModulePluginController = serviceProvider.GetService(typeof(IPluginController <>)) as IPluginController <TPluginItem>;

            this.modulePluginManager = serviceProvider.GetService(typeof(IPluginManager <>)) as IPluginManager <TPluginItem>;

            this.currentAppModulePluginItem = this.currentModulePluginController.PluginItem;

            if (this.mdiUIContainer == null)
            {
                throw new InfrastructureException("The container which is used to load this UI screen cannot be null. Please specify a container which inherits control. E.g. panel or form.");
            }

            if (this.mdiUIContainer != null &&
                !this.mdiUIContainer.Controls.Contains(this))
            {
                this.mdiUIContainer.SuspendLayout();

                this.Dock = DockStyle.Fill;

                this.mdiUIContainer.Controls.Add(this);
                this.mdiUIContainer.ResumeLayout();
            }

            this.Focus();

            this.Hide();
        }
Ejemplo n.º 2
0
        protected override void Initialize(IPluginServiceProvider serviceProvider)
        {
            if (serviceProvider.Contains(typeof(Ribbon)))
            {
                this.RibbonMenu = serviceProvider.GetService(typeof(Ribbon)) as Ribbon;

                if (this.RibbonMenu == null)
                {
                    throw new InfrastructureException("The service provide doesn't contain Ribbon control. Please specify a Ribbon control.");
                }
            }

            base.Initialize(serviceProvider);
        }