public void Function()
    {
        MultiLangString multiLangString = new MultiLangString();

        multiLangString.AddString(ISOCode.Language.L_en_EN, "My Text in English");
        multiLangString.AddString(ISOCode.Language.L_de_DE, "Mein Text in Deutsch");
        // Sorry there is no Klingon implemented :^)
    }
Ejemplo n.º 2
0
        /// <summary>
        /// The function is called during P8 initialization or registration the add-in, when GUI was already initialized and add-in can modify it. 
        /// </summary>
        /// <returns></returns>
        public bool OnInitGui()
        {
            Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu();
            MultiLangString mls = new MultiLangString();
            mls.AddString(ISOCode.Language.L_fr_FR, "Réordonner les terminaux multi-niveau");
            mls.AddString(ISOCode.Language.L_en_US, "Reorder multi-level terminals");
            oMenu.AddMenuItem(mls, "MLTReorderAction");

            return true;
        }
Ejemplo n.º 3
0
        private void SetShipProperties(Project project)
        {
            project.Properties.PROJ_DRAWINGNUMBER = this.MvProject.FileName;
            MultiLangString mls = new MultiLangString();

            mls.AddString(ISOCode.Language.L___, this.MvProject.ShipInfo.Yard + "-" + this.MvProject.ShipInfo.ShipNo);
            project.Properties.PROJ_TYPE = mls;
        }
Ejemplo n.º 4
0
        public static int GetActiveEplanVersion()
        {
            string eplanVersion = "0"; //default value = 0 to ensure, that EPLAN-version is correctly recognized

            //try new variable $(EPLAN_VERSION) first, if not valid, no possibility to get active get active EPLAN-version
            if (PathMap.SubstitutePath("$(EPLAN_VERSION)") != "$(EPLAN_VERSION)")
            {
                eplanVersion = PathMap.SubstitutePath("$(EPLAN_VERSION)");
            }
            else
            {
                //try different method to get version of executing eplan, in case the actual version doesn't support $(EPLAN_VERSION)
                string   dllFilename = Path.Combine(PathMap.SubstitutePath("$(BIN)"), "Eplan.EplApi.Baseu.dll");
                FileInfo fileInfo    = new FileInfo(dllFilename);
                if (fileInfo.Exists)
                {
                    var versionInfo = FileVersionInfo.GetVersionInfo(dllFilename);
                    //return main-version-infos (without build number)
                    if (versionInfo.ProductVersion.Length >= 5)
                    {
                        eplanVersion = versionInfo.ProductVersion.Substring(0, 5);
                    }
                }
            }

            if (eplanVersion == "0" || eplanVersion == "$(EPLAN_VERSION)")
            {
                MultiLangString multiLangErrorText = new MultiLangString();
                multiLangErrorText.AddString(ISOCode.Language.L_de_DE, "Die aktuelle EPLAN-Version konnte nicht ermittelt werden.");
                multiLangErrorText.AddString(ISOCode.Language.L_en_US, "Unable to get actual EPLAN-version.");
                ISOCode.Language guiLanguage = new Languages().GuiLanguage.GetNumber();
                string           errorText   = multiLangErrorText.GetStringToDisplay(guiLanguage);
                if (String.IsNullOrEmpty(errorText))
                {
                    //if actual GUI-language is not defined in multi-language-string, use en_US-text-version
                    errorText = multiLangErrorText.GetStringToDisplay(ISOCode.Language.L_en_US);
                }
                new BaseException(errorText, MessageLevel.Warning).FixMessage();
                eplanVersion = "0";
            }
            return(Convert.ToInt16(eplanVersion.Replace(".", string.Empty)));
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!this.IsValidPartNr())
            {
                MessageBox.Show("부품 종류와 부품 번호를 입력해야 합니다.");
                return;
            }

            string partNr           = comboBox4.Text;
            string category         = comboBox1.Text;
            string subCategory      = comboBox2.Text;
            string maker            = comboBox3.Text;
            string description1     = comboBox5.Text;
            string note             = textBox1.Text;
            string groupSymbolMacro = textBox2.Text;

            MDPartsManagement pm       = new MDPartsManagement();
            MDPartsDatabase   database = pm.OpenDatabase();
            MDPart            mdPart   = database.GetPart(partNr);

            if (mdPart != null)
            {
                MessageBox.Show(partNr + " 부품이 있습니다.");
                return;
            }

            DialogResult dr = MessageBox.Show(partNr + " 부품을 생성합니다.", "부품 생성 확인", MessageBoxButtons.OKCancel);

            if (DialogResult.OK != dr)
            {
                return;
            }


            Data.Mdb mdb        = Data.MdbFactory.GetUniqueInstance;
            string[] attributes = mdb.GetAttribute(comboBox1.Text, comboBox2.Text);


            mdPart = database.AddPart(partNr);
            if (mdPart == null)
            {
                MessageBox.Show(mdPart.PartNr + " 부품이 생성이 실패했습니다.");
                return;
            }

            mdPart.Variant = "0";
            mdPart.Properties.ARTICLE_PRODUCTGROUP     = attributes[0];
            mdPart.Properties.ARTICLE_PRODUCTSUBGROUP  = attributes[1];
            mdPart.Properties.ARTICLE_PRODUCTTOPGROUP  = attributes[2];
            mdPart.Properties.ARTICLE_MANUFACTURER     = maker.Trim().Length == 0 ? " " : maker;
            mdPart.Properties.ARTICLE_TYPENR           = partNr;
            mdPart.Properties.ARTICLE_NOTE             = note;
            mdPart.Properties.ARTICLE_GROUPSYMBOLMACRO = groupSymbolMacro;

            MultiLangString mls = new MultiLangString();

            mls.AddString(ISOCode.Language.L___, description1);
            mdPart.Properties.ARTICLE_DESCR1 = mls;

            mdb.AddAttribite(mdPart, category, subCategory);

            MessageBox.Show(mdPart.PartNr + " 부품이 생성되었습니다.");
        }