Пример #1
0
        private void InitializeComponent()
        {
            this.tabAddIns           = this.Factory.CreateRibbonTab();
            this.groupChemFormatter  = this.Factory.CreateRibbonGroup();
            this.buttonRDigitChanger = this.Factory.CreateRibbonButton();
            this.buttonChemFormula   = this.Factory.CreateRibbonButton();
            this.buttonIonFormula    = this.Factory.CreateRibbonButton();
            this.buttonChemName      = this.Factory.CreateRibbonButton();
            this.buttonStyleCitation = this.Factory.CreateRibbonButton();
            this.buttonAlphaD        = this.Factory.CreateRibbonButton();
            this.buttonStyleAsChar   = this.Factory.CreateRibbonButton();
            this.tabAddIns.SuspendLayout();
            this.groupChemFormatter.SuspendLayout();
            this.SuspendLayout();

            //
            // tabAddIns
            //
            this.tabAddIns.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
            this.tabAddIns.Groups.Add(this.groupChemFormatter);
            this.tabAddIns.Label = "TabAddIns";
            this.tabAddIns.Name  = "tabAddIns";
            //
            // groupChemFormatter
            //
            this.groupChemFormatter.Items.Add(this.buttonRDigitChanger);
            this.groupChemFormatter.Items.Add(this.buttonChemFormula);
            this.groupChemFormatter.Items.Add(this.buttonIonFormula);
            this.groupChemFormatter.Items.Add(this.buttonChemName);
            this.groupChemFormatter.Items.Add(this.buttonStyleCitation);
            this.groupChemFormatter.Items.Add(this.buttonAlphaD);
            this.groupChemFormatter.Items.Add(this.buttonStyleAsChar);
            this.groupChemFormatter.Label = "ChemFormatter";
            this.groupChemFormatter.Name  = "groupChemFormatter";

            //
            // buttonRDigitChanger
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.RDigitChangerImage);
                if (im != null)
                {
                    this.buttonRDigitChanger.Image = im;
                }
            }
            this.buttonRDigitChanger.Label     = CommonResourceManager.TextSubDigitsChange;
            this.buttonRDigitChanger.Name      = "buttonRDigitChanger";
            this.buttonRDigitChanger.Click    += (sender, e) => Globals.ThisAddIn.ButtonRDigitChanger_Click(sender, e);
            this.buttonRDigitChanger.ShowLabel = true;
            this.buttonRDigitChanger.ShowImage = true;
            //
            // buttonChemFormula
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.ChemFormulaImage);
                if (im != null)
                {
                    this.buttonChemFormula.Image = im;
                }
            }
            this.buttonChemFormula.Label     = CommonResourceManager.TextChemFormula;
            this.buttonChemFormula.Name      = "buttonChemFormula";
            this.buttonChemFormula.Click    += (sender, e) => Globals.ThisAddIn.ButtonChemFormular_Click(sender, e);
            this.buttonChemFormula.ShowLabel = true;
            this.buttonChemFormula.ShowImage = true;
            //
            // buttonIonFormula
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.IonFormulaImage);
                if (im != null)
                {
                    this.buttonIonFormula.Image = im;
                }
            }
            this.buttonIonFormula.Label     = CommonResourceManager.TextIonFormula;
            this.buttonIonFormula.Name      = "buttonIonFormula";
            this.buttonIonFormula.Click    += (sender, e) => Globals.ThisAddIn.ButtonIonFormular_Click(sender, e);
            this.buttonIonFormula.ShowLabel = true;
            this.buttonIonFormula.ShowImage = true;
            //
            // buttonChemName
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.ChemNameImage);
                if (im != null)
                {
                    this.buttonChemName.Image = im;
                }
            }
            this.buttonChemName.Label     = CommonResourceManager.TextChemName;
            this.buttonChemName.Name      = "buttonChemName";
            this.buttonChemName.Click    += (sender, e) => Globals.ThisAddIn.ButtonChemName_Click(sender, e);
            this.buttonChemName.ShowLabel = true;
            this.buttonChemName.ShowImage = true;
            //
            // buttonStyleCitation
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.JournalReferenceImage);
                if (im != null)
                {
                    this.buttonStyleCitation.Image = im;
                }
            }
            this.buttonStyleCitation.Label     = CommonResourceManager.TextCitation;
            this.buttonStyleCitation.Name      = "buttonStyleCitation";
            this.buttonStyleCitation.Click    += (sender, e) => Globals.ThisAddIn.ButtonStyleCitation_Click(sender, e);
            this.buttonStyleCitation.ShowLabel = true;
            this.buttonStyleCitation.ShowImage = true;
            //
            // buttonAlphaD
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.AlphaDImage);
                if (im != null)
                {
                    this.buttonAlphaD.Image = im;
                }
            }
            this.buttonAlphaD.Label     = CommonResourceManager.TextOpticalRotation;
            this.buttonAlphaD.Name      = "buttonAlphaD";
            this.buttonAlphaD.Click    += (sender, e) => Globals.ThisAddIn.ButtonAlphaD_Click(sender, e);
            this.buttonAlphaD.ShowLabel = true;
            this.buttonAlphaD.ShowImage = true;
            //
            // buttonStyleAsChar
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.StyleAsCharImage);
                if (im != null)
                {
                    this.buttonStyleAsChar.Image = im;
                }
            }
            this.buttonStyleAsChar.Label     = CommonResourceManager.TextStyleAsChar;
            this.buttonStyleAsChar.Name      = "buttonStyleAsChar";
            this.buttonStyleAsChar.Click    += (sender, e) => Globals.ThisAddIn.ButtonStyleAsChar_Click(sender, e);
            this.buttonStyleAsChar.ShowLabel = true;
            this.buttonStyleAsChar.ShowImage = true;
            //
            // Ribbon
            //
            this.Name       = "Ribbon";
            this.RibbonType = "Microsoft.PowerPoint.Presentation";
            this.Tabs.Add(this.tabAddIns);
            this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler((sender, e) => Ribbon_Load(sender, e));
            this.tabAddIns.ResumeLayout(false);
            this.tabAddIns.PerformLayout();
            this.groupChemFormatter.ResumeLayout(false);
            this.groupChemFormatter.PerformLayout();
            this.ResumeLayout(false);
        }
Пример #2
0
        private void InitializeComponent()
        {
            this.tabAddIns              = this.Factory.CreateRibbonTab();
            this.groupChemFormatter     = this.Factory.CreateRibbonGroup();
            this.buttonRDigitChanger    = this.Factory.CreateRibbonButton();
            this.buttonChemFormula      = this.Factory.CreateRibbonButton();
            this.buttonIonFormula       = this.Factory.CreateRibbonButton();
            this.buttonChemName         = this.Factory.CreateRibbonButton();
            this.buttonStyleCitation    = this.Factory.CreateRibbonButton();
            this.buttonAlphaD           = this.Factory.CreateRibbonButton();
            this.buttonStyleAsChar      = this.Factory.CreateRibbonButton();
            this.buttonNMRSpec          = this.Factory.CreateRibbonButton();
            this.dropDownNMRFormat      = this.Factory.CreateRibbonDropDown();
            this.dropDownItem_NMRIPJC   = this.Factory.CreateRibbonDropDownItem();
            this.dropDownItem_NMRPJIC   = this.Factory.CreateRibbonDropDownItem();
            this.dropDownItem_NMRIPJC_N = this.Factory.CreateRibbonDropDownItem();
            this.dropDownItem_NMRPJIC_N = this.Factory.CreateRibbonDropDownItem();
            this.tabAddIns.SuspendLayout();
            this.groupChemFormatter.SuspendLayout();
            this.SuspendLayout();

            //
            // tabAddIns
            //
            this.tabAddIns.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office;
            this.tabAddIns.Groups.Add(this.groupChemFormatter);
            this.tabAddIns.Label = "TabAddIns";
            this.tabAddIns.Name  = "tabAddIns";
            //
            // groupChemFormatter
            //
            this.groupChemFormatter.Items.Add(this.buttonRDigitChanger);
            this.groupChemFormatter.Items.Add(this.buttonChemFormula);
            this.groupChemFormatter.Items.Add(this.buttonIonFormula);
            this.groupChemFormatter.Items.Add(this.buttonChemName);
            this.groupChemFormatter.Items.Add(this.buttonStyleCitation);
            this.groupChemFormatter.Items.Add(this.buttonAlphaD);
            this.groupChemFormatter.Items.Add(this.buttonStyleAsChar);
            this.groupChemFormatter.Items.Add(this.buttonNMRSpec);
            this.groupChemFormatter.Items.Add(this.dropDownNMRFormat);
            this.groupChemFormatter.Label = "ChemFormatter";
            this.groupChemFormatter.Name  = "groupChemFormatter";

            //
            // buttonRDigitChanger
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.RDigitChangerImage);
                if (im != null)
                {
                    this.buttonRDigitChanger.Image = im;
                }
            }
            this.buttonRDigitChanger.Label     = CommonResourceManager.TextSubDigitsChange;
            this.buttonRDigitChanger.Name      = "buttonRDigitChanger";
            this.buttonRDigitChanger.Click    += (sender, e) => Globals.ThisAddIn.ButtonRDigitChanger_Click(sender, e);
            this.buttonRDigitChanger.ShowLabel = true;
            this.buttonRDigitChanger.ShowImage = true;
            //
            // buttonChemFormula
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.ChemFormulaImage);
                if (im != null)
                {
                    this.buttonChemFormula.Image = im;
                }
            }
            this.buttonChemFormula.Label     = CommonResourceManager.TextChemFormula;
            this.buttonChemFormula.Name      = "buttonChemFormula";
            this.buttonChemFormula.Click    += (sender, e) => Globals.ThisAddIn.ButtonChemFormular_Click(sender, e);
            this.buttonChemFormula.ShowLabel = true;
            this.buttonChemFormula.ShowImage = true;
            //
            // buttonIonFormula
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.IonFormulaImage);
                if (im != null)
                {
                    this.buttonIonFormula.Image = im;
                }
            }
            this.buttonIonFormula.Label     = CommonResourceManager.TextIonFormula;
            this.buttonIonFormula.Name      = "buttonIonFormula";
            this.buttonIonFormula.Click    += (sender, e) => Globals.ThisAddIn.ButtonIonFormular_Click(sender, e);
            this.buttonIonFormula.ShowLabel = true;
            this.buttonIonFormula.ShowImage = true;
            //
            // buttonChemName
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.ChemNameImage);
                if (im != null)
                {
                    this.buttonChemName.Image = im;
                }
            }
            this.buttonChemName.Label     = CommonResourceManager.TextChemName;
            this.buttonChemName.Name      = "buttonChemName";
            this.buttonChemName.Click    += (sender, e) => Globals.ThisAddIn.ButtonChemName_Click(sender, e);
            this.buttonChemName.ShowLabel = true;
            this.buttonChemName.ShowImage = true;
            //
            // buttonStyleCitation
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.JournalReferenceImage);
                if (im != null)
                {
                    this.buttonStyleCitation.Image = im;
                }
            }
            this.buttonStyleCitation.Label     = CommonResourceManager.TextCitation;
            this.buttonStyleCitation.Name      = "buttonStyleCitation";
            this.buttonStyleCitation.Click    += (sender, e) => Globals.ThisAddIn.ButtonStyleCitation_Click(sender, e);
            this.buttonStyleCitation.ShowLabel = true;
            this.buttonStyleCitation.ShowImage = true;
            //
            // buttonAlphaD
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.AlphaDImage);
                if (im != null)
                {
                    this.buttonAlphaD.Image = im;
                }
            }
            this.buttonAlphaD.Label     = CommonResourceManager.TextOpticalRotation;
            this.buttonAlphaD.Name      = "buttonAlphaD";
            this.buttonAlphaD.Click    += (sender, e) => Globals.ThisAddIn.ButtonAlphaD_Click(sender, e);
            this.buttonAlphaD.ShowLabel = true;
            this.buttonAlphaD.ShowImage = true;
            //
            // buttonStyleAsChar
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.StyleAsCharImage);
                if (im != null)
                {
                    this.buttonStyleAsChar.Image = im;
                }
            }
            this.buttonStyleAsChar.Label     = CommonResourceManager.TextStyleAsChar;
            this.buttonStyleAsChar.Name      = "buttonStyleAsChar";
            this.buttonStyleAsChar.Click    += (sender, e) => Globals.ThisAddIn.ButtonStyleAsChar_Click(sender, e);
            this.buttonStyleAsChar.ShowLabel = true;
            this.buttonStyleAsChar.ShowImage = true;
            //
            // buttonNMRSpec
            //
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.NMRSpecImage);
                if (im != null)
                {
                    this.buttonNMRSpec.Image = im;
                }
            }
            this.buttonNMRSpec.Label     = CommonResourceManager.TextNMRSpec;
            this.buttonNMRSpec.Name      = "buttonNMRSpec";
            this.buttonNMRSpec.Click    += (sender, e) => Globals.ThisAddIn.ButtonNMRSpec_Click(sender, e);
            this.buttonNMRSpec.ShowLabel = true;
            this.buttonNMRSpec.ShowImage = true;
            //
            // dropDownNMRFormat
            //
            this.dropDownNMRFormat.Label             = CommonResourceManager.TextNMRFormat;
            this.dropDownNMRFormat.Name              = "dropDownNMRFormat";
            this.dropDownNMRFormat.SelectionChanged += (sender, e) => Globals.ThisAddIn.DropDownNMRFormat_SelectionChanged(sender, e);
            this.dropDownNMRFormat.ShowLabel         = true;
            this.dropDownNMRFormat.ShowImage         = false;
            this.dropDownNMRFormat.ShowItemLabel     = false;
            this.dropDownNMRFormat.ShowItemImage     = true;
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.NMRFormat_IPJC);
                if (im != null)
                {
                    this.dropDownItem_NMRIPJC.Image = im;
                }
                var f = ChemFormatter.NMRFormat.IPJC;
                this.dropDownItem_NMRIPJC.Label = f.Label;
                this.dropDownItem_NMRIPJC.Tag   = f;
                this.dropDownNMRFormat.Items.Add(this.dropDownItem_NMRIPJC);
            }
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.NMRFormat_PJIC);
                if (im != null)
                {
                    this.dropDownItem_NMRPJIC.Image = im;
                }
                var f = ChemFormatter.NMRFormat.PJIC;
                this.dropDownItem_NMRPJIC.Label = f.Label;
                this.dropDownItem_NMRPJIC.Tag   = f;
                this.dropDownNMRFormat.Items.Add(this.dropDownItem_NMRPJIC);
            }
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.NMRFormat_PlainIPJC);
                if (im != null)
                {
                    this.dropDownItem_NMRIPJC_N.Image = im;
                }
                var f = ChemFormatter.NMRFormat.PlainIPJC;
                this.dropDownItem_NMRIPJC_N.Label = f.Label;
                this.dropDownItem_NMRIPJC_N.Tag   = f;
                this.dropDownNMRFormat.Items.Add(this.dropDownItem_NMRIPJC_N);
            }
            {
                var im = CommonResourceManager.GetImage(CommonResourceManager.NMRFormat_PlainPJIC);
                if (im != null)
                {
                    this.dropDownItem_NMRPJIC_N.Image = im;
                }
                var f = ChemFormatter.NMRFormat.PlainPJIC;
                this.dropDownItem_NMRPJIC_N.Label = f.Label;
                this.dropDownItem_NMRPJIC_N.Tag   = f;
                this.dropDownNMRFormat.Items.Add(this.dropDownItem_NMRPJIC_N);
            }
            //
            // Ribbon
            //
            this.Name       = "Ribbon";
            this.RibbonType = "Microsoft.Word.Document";
            this.Tabs.Add(this.tabAddIns);
            this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler((sender, e) => Ribbon_Load(sender, e));
            this.tabAddIns.ResumeLayout(false);
            this.tabAddIns.PerformLayout();
            this.groupChemFormatter.ResumeLayout(false);
            this.groupChemFormatter.PerformLayout();
            this.ResumeLayout(false);
        }