Example #1
0
        private void Navigator_ItemAdd(object sender, TypeEventArgs e)
        {
            this.m_SelectLast = true;
            Iocomp.Classes.CollectionBase collectionBase = base.WorkingInstance as Iocomp.Classes.CollectionBase;
            object value = GPFunctions.CreateInstance(e.Type, e.Type.FullName);

            ((IList)collectionBase).Add(value);
            base.Master.ForceDirtyUpdate(null);
        }
Example #2
0
        private bool GetIsDisplayDirty(object original)
        {
            object displayValue = this.PropertyAdapter.GetDisplayValue(original);

            if (displayValue == null)
            {
                return(false);
            }
            if (displayValue is Font)
            {
                return(!GPFunctions.Equals((Font)displayValue, this.Font));
            }
            return(false);
        }
Example #3
0
 private object CreatePlugInByFullName(string fullName)
 {
     return((PlugInStandard)GPFunctions.CreateInstance(null, fullName));
 }
Example #4
0
        private void SetupDesignTime(bool showAbout)
        {
            this.MainForm                            = new Form();
            this.MainForm.Text                       = this.MainPlugInTitle;
            this.MainForm.FormBorderStyle            = FormBorderStyle.FixedDialog;
            this.MainForm.StartPosition              = FormStartPosition.CenterScreen;
            this.MainForm.ShowInTaskbar              = false;
            this.MainForm.MaximizeBox                = false;
            this.MainForm.MinimizeBox                = false;
            this.m_ScaleRatio                        = (float)((int)Math.Ceiling((double)this.MainForm.Font.GetHeight()) / this.MainForm.AutoScaleBaseSize.Height);
            this.MainForm.AutoScaleMode              = AutoScaleMode.None;
            this.m_ControlPanel                      = new PlugInControlPanel();
            this.m_ControlPanel.Dock                 = DockStyle.Bottom;
            this.m_ControlPanel.OKButton.Click      += this.ControlPanel_OkButtonClick;
            this.m_ControlPanel.CancelButton.Click  += this.ControlPanel_CancelButtonClick;
            this.m_ControlPanel.ApplyButton.Click   += this.ControlPanel_ApplyButtonClick;
            this.m_ControlPanel.ResetButton.Click   += this.ResetButton_Click;
            this.m_ControlPanel.RestoreButton.Click += this.RestoreButton_Click;
            this.UpdateExtents(this.m_ControlPanel.RequiredWidthMin, 0);
            this.MainForm.Controls.Add(this.m_ControlPanel);
            this.m_WorkingInstance = GPFunctions.CreateInstance(this.m_OriginalInstance.GetType(), this.m_OriginalInstance.GetType().FullName);
            this.m_RestoreInstance = GPFunctions.CreateInstance(this.m_OriginalInstance.GetType(), this.m_OriginalInstance.GetType().FullName);
            this.m_ResetInstance   = GPFunctions.CreateInstance(this.m_OriginalInstance.GetType(), this.m_OriginalInstance.GetType().FullName);
            if (this.m_OriginalInstance is SubClassBase)
            {
                (this.m_OriginalInstance as ISubClassBase).ResetClone(this.m_ResetInstance as SubClassBase);
            }
            if (this.m_ResetInstance is IComponentBase)
            {
                (this.m_ResetInstance as IComponentBase).SetComponentDefaults();
            }
            if (this.m_ResetInstance is CollectionBase)
            {
                (this.m_ResetInstance as CollectionBase).Reset();
            }
            if (this.m_OriginalInstance is IControlBase)
            {
                this.I_ControlBase     = (this.m_OriginalInstance as IControlBase);
                this.m_SurrogateParent = new Label();
                if (this.I_ControlBase._Parent != null)
                {
                    this.m_SurrogateParent.BackColor = this.I_ControlBase._Parent.BackColor;
                    this.m_SurrogateParent.ForeColor = this.I_ControlBase._Parent.ForeColor;
                    this.m_SurrogateParent.Font      = this.I_ControlBase._Parent.Font;
                }
                (this.m_WorkingInstance as Control).Parent = this.m_SurrogateParent;
                (this.m_ResetInstance as Control).Parent   = this.m_SurrogateParent;
                (this.m_RestoreInstance as Control).Parent = this.m_SurrogateParent;
            }
            else if (this.m_OriginalInstance is ISubClassBase)
            {
                this.I_ControlBase = (this.m_OriginalInstance as ISubClassBase).ControlBase;
                (this.m_WorkingInstance as ISubClassBase).ControlBase  = this;
                (this.m_ResetInstance as ISubClassBase).ControlBase    = this;
                (this.m_RestoreInstance as ISubClassBase).ControlBase  = this;
                (this.m_WorkingInstance as ISubClassBase).AmbientOwner = (this.m_OriginalInstance as ISubClassBase).AmbientOwner;
                (this.m_ResetInstance as ISubClassBase).AmbientOwner   = (this.m_OriginalInstance as ISubClassBase).AmbientOwner;
                (this.m_RestoreInstance as ISubClassBase).AmbientOwner = (this.m_OriginalInstance as ISubClassBase).AmbientOwner;
            }
            else if (this.m_OriginalInstance is ICollectionBase)
            {
                (this.m_WorkingInstance as ICollectionBase).ComponentBase = (this.m_OriginalInstance as ICollectionBase).ComponentBase;
                (this.m_ResetInstance as ICollectionBase).ComponentBase   = (this.m_OriginalInstance as ICollectionBase).ComponentBase;
                (this.m_RestoreInstance as ICollectionBase).ComponentBase = (this.m_OriginalInstance as ICollectionBase).ComponentBase;
            }
            TabControl tabControl = new TabControl();

            this.MainForm.Controls.Add(tabControl);
            tabControl.Dock = DockStyle.Fill;
            if (this.m_OriginalInstance is SubClassBase)
            {
                this.MainPlugIn.TabName = "General";
            }
            else
            {
                this.MainPlugIn.TabName = "Control";
            }
            this.MainPlugIn.TabControl = tabControl;
            TabPage tabPage = new TabPage();

            tabPage.Text = "About";
            tabControl.Controls.Add(tabPage);
            this.m_TabPageBorderSize = 4;
            this.m_TabPageDockMargin = 8;
            this.m_TabHeight         = tabControl.Height - tabControl.DisplayRectangle.Height - 8;
            tabControl.Controls.Remove(tabPage);
            tabPage.Dispose();
            int tabPageBorderSize  = this.TabPageBorderSize;
            int tabPageBorderSize2 = this.TabPageBorderSize;
            int offsetTop          = this.TabHeight + this.TabPageBorderSize;
            int tabPageBorderSize3 = this.TabPageBorderSize;

            this.MainPlugIn.DoTabs(tabControl, true, tabPageBorderSize, tabPageBorderSize2, offsetTop, tabPageBorderSize3, this.m_ScaleRatio, this, this.MainPlugIn.ClassPlugIns);
            if (showAbout)
            {
                this.m_AboutPlugIn         = new AboutPlugIn();
                this.m_AboutPlugIn.TabName = "About";
                this.m_AboutPlugIn.DoTabs(tabControl, true, tabPageBorderSize, tabPageBorderSize2, offsetTop, tabPageBorderSize3, this.m_ScaleRatio, this, this.MainPlugIn.SubPlugIns);
            }
            this.MainPlugIn.WorkingInstance  = this.m_WorkingInstance;
            this.MainPlugIn.OriginalInstance = this.m_OriginalInstance;
            this.TransferAmbient(this.m_OriginalInstance, this.m_WorkingInstance);
            this.TransferAmbient(this.m_OriginalInstance, this.m_RestoreInstance);
            this.MainPlugIn.UploadDisplay();
            this.MainForm.ClientSize = new Size(this.m_MaxWidth, this.m_MaxHeight + this.m_ControlPanel.Height);
            tabControl.Dock          = DockStyle.None;
            tabControl.Height        = this.m_MaxHeight;
            tabControl.Width         = this.m_MaxWidth;
            this.MainPlugIn.FixupAlign();
            this.m_ControlPanel.Dock  = DockStyle.None;
            this.m_ControlPanel.Width = this.MainForm.ClientSize.Width;
            this.m_ControlPanel.Top   = this.MainForm.ClientSize.Height - this.m_ControlPanel.Height;
            this.m_ControlPanel.DoLayout();
            this.UpdateControlPanel();
        }