/// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            string strAction = "ActionApiExtWithParameters";

            ActionManager oAMnr   = new ActionManager();
            Action        oAction = oAMnr.FindAction(strAction);

            if (oAction != null)
            {
                ActionCallingContext callingCtx = new ActionCallingContext();

                callingCtx.AddParameter("Param1", "Action Param1");
                callingCtx.AddParameter("Param2", "Action Param2");
                callingCtx.AddParameter("Param3", "Action Param3");

                bool bRet = oAction.Execute(callingCtx);

                if (bRet)
                {
                    string returnValue = null;
                    callingCtx.GetParameter("ReturnParam", ref returnValue);

                    MessageDisplayHelper.Show(string.Format("The Action [{0}] ended successfully with returnValue = [{1}]", strAction, returnValue), "ActionApiExtCallOtherAction");
                }
                else
                {
                    MessageDisplayHelper.Show(string.Format("The Action [{0}] ended with errors!", strAction), "ActionApiExtCallOtherAction", EnumDecisionIcon.eEXCLAMATION);
                }
            }

            return(true);
        }
Example #2
0
 void Instace_OrderRptCallbackEvent(object sender, ReckoningCounter.BLL.Reckoning.Instantaneous.RuntimeMessageEventArge e)
 {
     MessageDisplayHelper.Event(e.RuntimeMessage, lbOrderRpt);
     ordercount++;
     //textBox2.Text = ordercount.ToString();
     SetMessage(textBox2, ordercount.ToString());
 }
Example #3
0
 void Instace_CancelOrderCallbackEvent(object sender, ReckoningCounter.BLL.Reckoning.Instantaneous.RuntimeMessageEventArge e)
 {
     MessageDisplayHelper.Event(e.RuntimeMessage, lbCancelOrderRpt);
     cacelcount++;
     //textBox3.Text = cacelcount.ToString();
     SetMessage(textBox3, cacelcount.ToString());
 }
Example #4
0
 void Instace_DealRptCallbackEvent(object sender, ReckoningCounter.BLL.Reckoning.Instantaneous.RuntimeMessageEventArge e)
 {
     MessageDisplayHelper.Event(e.RuntimeMessage, lbDealRpt);
     dealcount++;
     //textBox1.Text = dealcount.ToString();
     SetMessage(textBox1, dealcount.ToString());
 }
Example #5
0
        /// <summary>
        /// 商品期货行情调度事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void CommditiesRealtimeMarketChangeEvent(object sender, MercantileFutDataChangeEventArg e)
        {
            if (e == null || e.HqData == null)
            {
                return;
            }

            if (!MatchCodeDictionary.spqh_ActivityOrderDic.ContainsKey(e.HqData.CodeKey))
            {
                return;
            }

            //不显示行情信息就不再处理
            if (isShowRealTimeMsg)
            {
                string nowTime = DateTime.Now.ToString();
                var    data    = e.HqData;
                string msg     = data.CodeKey + "行情到达:{0}  行情时间:{1} 成交价:{2}--{3}\r\n";
                msg += "卖一:{4}--{5}   卖五:{6}--{7}   ";
                msg += "买一:{8}--{9}   买五:{10}--{11}\r\n  ";
                string wrmsg = string.Format(msg, nowTime, data.Time, data.Lasttrade, e.HqData.PTrans, data.Sellprice1, data.Sellvol1, data.Sellprice5, data.Sellvol5
                                             , data.Buyprice1, data.Buyvol1, data.Buyprice5, data.Buyvol5);
                smartPool.QueueWorkItem(delegate(object state) { MessageDisplayHelper.Event((string)state, ListCFHQWork); }, wrmsg);
            }

            smartPool.QueueWorkItem(FindCommditiesMatchCode, e);
        }
Example #6
0
        private void btnProjectReadProperties_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProject))
            {
                return;
            }

            try
            {
                ISOCode       guiLang       = ApiExtHelpers.GetEplanGUILanguage();
                Project       targetProject = ProjectHelper.GetProject(this.txtProject.Text);
                StringBuilder propertyText  = new StringBuilder();
                propertyText.AppendFormat("Project [{1}] Properties{0}{0}", Environment.NewLine, targetProject.ProjectName);

                propertyText.AppendFormat("Job Number = [{1}]{0}", Environment.NewLine, targetProject.Properties[10013]);
                propertyText.AppendFormat("EPLAN.Project.UserSupplementaryField1 = [{1}]{0}{0}", Environment.NewLine, targetProject.Properties["EPLAN.Project.UserSupplementaryField1"]);

                propertyText.AppendFormat("SupplementaryField[11]{0}", Environment.NewLine);
                propertyText.AppendFormat(" ToString() = [{1}]{0}", Environment.NewLine, targetProject.Properties[10901, 11]);
                propertyText.AppendFormat(" ToString(Lang) = [{1}]{0}", Environment.NewLine, targetProject.Properties[10901, 11].ToString(guiLang.GetNumber()));
                propertyText.AppendFormat(" ToMultiLangString().GetStringToDisplay(Lang) = [{1}]{0}{0}", Environment.NewLine, targetProject.Properties[10901, 11].ToMultiLangString().GetStringToDisplay(guiLang.GetNumber()));

                propertyText.AppendFormat("Project Description = [{1}]{0}", Environment.NewLine, targetProject.Properties[10011]);

                MessageDisplayHelper.Show(propertyText.ToString(), "::: Read Project Properties");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Read Properties Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Read Project Properties", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #7
0
        private void btnProjectOpenElk_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProjectOpenElk))
            {
                return;
            }

            try
            {
                using (ProjectManager projectManager = new ProjectManager())
                {
                    projectManager.OpenProject(this.txtProjectOpenElk.Text, ProjectManager.OpenMode.Standard, false);

                    if (string.IsNullOrWhiteSpace(this.txtProject.Text))
                    {
                        this.txtProject.Text = this.txtProjectOpenElk.Text;
                    }
                }

                MessageDisplayHelper.Show("Project Open Completed!", "::: Open Project");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Project Open Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Open Project", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #8
0
        private void btnPageExportPDF_Click(object sender, EventArgs e)
        {
            if (!ValidatePageSelected(this.cBoxPagePages))
            {
                return;
            }

            try
            {
                Page targetPage = ((EplanPageViewModel)this.cBoxPagePages.SelectedItem).Page;

                using (Export pdfExport = new Export())
                {
                    string pdfFileName = string.Format("{0}_{1}_{2}.pdf", Path.GetFileNameWithoutExtension(this.txtProject.Text), StringHelper.ReplaceNotAllowedFileNameCharsWith(targetPage.Name, '_'), DateTime.Now.ToString("yyMMdd.HHmmssfff"));
                    string pdfFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "EPLANApiExt", pdfFileName);

                    pdfExport.PdfPages(new ArrayList {
                        targetPage
                    }, "EPLAN_default_value", pdfFullPath, Export.DegreeOfColor.Color, this.checkBoxPageInclude3D.Checked, string.Empty, true);

                    MessageDisplayHelper.Show("PDF Export Completed!", "::: Export PDF");
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("PDF Export Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Export PDF", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #9
0
        private void btnProjectRestoreZw1_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProjectRestoreZw1))
            {
                return;
            }

            try
            {
                using (Restore restoreZw1 = new Restore())
                {
                    StringCollection targetZw1Path = new StringCollection();
                    targetZw1Path.Add(this.txtProjectRestoreZw1.Text);

                    string restorePath         = string.Format("{0}\\EPLANApiExt", Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
                    string restoredProjectName = string.Format("{0}_{1}", Path.GetFileNameWithoutExtension(this.txtProjectRestoreZw1.Text), DateTime.Now.ToString("yyMMdd.HHmmssfff"));

                    restoreZw1.Project(targetZw1Path, restorePath, restoredProjectName, false, false);
                    this.txtProjectOpenElk.Text = string.Format("{0}.elk", Path.Combine(restorePath, restoredProjectName));

                    MessageDisplayHelper.Show("Project Restore Completed!", "::: Restore Project");
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Project Restore Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Restore Project", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #10
0
        void Instance_DoOfferOrderEvent(object sender, ReckoningCounter.BLL.Reckoning.Instantaneous.RuntimeMessageEventArge e)
        {
            MessageDisplayHelper.Event(e.RuntimeMessage, listBox1);
            count++;

            //SetMessage(textBox1,count.ToString());
            //textBox1.Text = count.ToString();
        }
 void ProcessDoOrder(int iOrderCount, DoOrderClient client, int selectIndex)
 {
     for (int i = 0; i < iOrderCount; i++)
     {
         OrderResponse or = client.DoStockOrder(BuildOrder(selectIndex));
         MessageDisplayHelper.Event("OrderID:" + or.OrderId + " Message:" + or.OrderMessage, this.listBox1);
     }
 }
Example #12
0
        private bool ValidateProjectSelected(TextBox projectName)
        {
            if (string.IsNullOrWhiteSpace(projectName.Text))
            {
                MessageDisplayHelper.Show("Please Select Project First!", "::: Select Project");
                return(false);
            }

            return(true);
        }
Example #13
0
        private bool ValidatePageSelected(ComboBox cBoxPages)
        {
            if (cBoxPages.SelectedIndex == -1)
            {
                MessageDisplayHelper.Show("Please Select Page First!", "::: Select Page");
                return(false);
            }

            return(true);
        }
Example #14
0
        /// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            string strParamValue = null;

            ctx.GetParameter("Param1", ref strParamValue);

            MessageDisplayHelper.Show(string.Format("Action was called, Param1=[{0}]", strParamValue), "FirstAction");

            // fill parameter "ReturnParam" with value "return value".
            // the caller of this action can extract the parameter by ctx.getParameter("ReturnParam", ...)

            string strReturnValue = "Return Value";

            ctx.AddParameter("ReturnParam", strReturnValue);

            return(true);
        }
        /// <summary>
        /// 지정된 Functiuon에 대하여, 이미지를 생성
        /// - 이미 생성된 이미지가 있는 경우, 기존 이미지를 삭제하고 신규로 생성하는 방식 사용
        /// - 이미지 너비(Width)만 지정하고, 높이(Height)는 이미지 비율에 따라 자동으로 지정됨
        /// </summary>
        /// <param name="function">대상 Function</param>
        /// <param name="imageWidth">이미지 너비</param>
        /// <param name="gapFromSymbol">심볼에서 이미지 배치 상대 위치, (-): 왼쪽 배치, (+): 오른쪽 배치</param>
        public static void DoImage(this Function function, double imageWidth = 30.0, double gapFromSymbol = -10)
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            Image functionImage = null;

            try
            {
                using (SafetyPoint safetyPoint = SafetyPoint.Create())
                {
                    functionImage = FindFunctionImage(function);
                    Article part = function.Articles.FirstOrDefault();

                    if (functionImage != null)
                    {
                        functionImage.Remove();
                        functionImage = null;
                    }

                    if (part != null)
                    {
                        CreateNewImage(function, part, imageWidth, gapFromSymbol);
                    }

                    safetyPoint.Commit();
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("이미지 박스 추가 실패{1}ex.Message=[{0}]", ex.Message, Environment.NewLine), "DoImage", EnumDecisionIcon.eEXCLAMATION);
            }
            finally
            {
                ApiExtHelpers.RefreshDrawing();

                if (functionImage != null)
                {
                    functionImage.Dispose();
                    functionImage = null;
                }
            }
        }
Example #16
0
        private void btnPage2Search_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProject))
            {
                return;
            }

            try
            {
                using (PagePropertyList properties = new PagePropertyList())
                {
                    if (!string.IsNullOrWhiteSpace(this.txtPage2HLF.Text))
                    {
                        properties.DESIGNATION_PLANT = this.txtPage2HLF.Text.Trim();
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtPage2ML.Text))
                    {
                        properties.DESIGNATION_LOCATION = this.txtPage2ML.Text.Trim();
                    }
                    if (!string.IsNullOrWhiteSpace(this.txtPage2PageName.Text))
                    {
                        properties.PAGE_NAME = this.txtPage2PageName.Text.Trim();
                    }

                    Page[] resultPages = SerachPage(ProjectHelper.GetProject(this.txtProject.Text), properties);

                    if (resultPages.Length == 0)
                    {
                        MessageDisplayHelper.Show("No Page Found", "::: Page Search");
                    }
                    else
                    {
                        foreach (var page in resultPages)
                        {
                            MessageDisplayHelper.Show(string.Format("{0} <{1}>", page.Name, page.Properties[Properties.Page.PAGE_NOMINATIOMN]), "::: Page Search");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Search Page Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Page Search", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #17
0
        private void btnPage2Delete_Click(object sender, EventArgs e)
        {
            if (!ValidatePageSelected(this.cBoxPageCreatePages))
            {
                return;
            }

            try
            {
                Page targetPage = ((EplanPageViewModel)this.cBoxPageCreatePages.SelectedItem).Page;
                DeletePage(new[] { targetPage });

                RefreshProjectPages(this.cBoxPageCreatePages);
                MessageDisplayHelper.Show("Page Deleted!", "::: Page Delete");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Delete Page Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Page Delete", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #18
0
        /// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            string param1 = null;

            ctx.GetParameter("Param1", ref param1);

            string param2 = null;

            ctx.GetParameter("Param2", ref param2);

            string param3 = null;

            ctx.GetParameter("Param3", ref param3);

            MessageDisplayHelper.Show(string.Format("ActionApiExtWithParameters{3}[Param1: {0}]{3}[Param2: {1}]{3}[Param3: {2}]{3}was called!", param1, param2, param3, Environment.NewLine), "ActionApiExtWithParameters");

            ctx.AddParameter("ReturnParam", "Action ReturnParam!!!");

            return(true);
        }
Example #19
0
        /// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            try
            {
                SelectionSet selection = new SelectionSet();

                foreach (var function in selection.Selection.OfType <Function>())
                {
                    function.SymbolVariant = SymbolVariantHelper.GetNext(function.SymbolVariant);
                }

                ApiExtHelpers.RefreshDrawing();
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Symbol Change Error{1}error=[{0}]", ex.Message, Environment.NewLine), "ActionNextSymbolVariant", EnumDecisionIcon.eEXCLAMATION);
            }

            return(true);
        }
Example #20
0
        private void btnPageSetProperties_Click(object sender, EventArgs e)
        {
            if (!ValidatePageSelected(this.cBoxPagePages))
            {
                return;
            }

            try
            {
                Page targetPage = ((EplanPageViewModel)this.cBoxPagePages.SelectedItem).Page;

                targetPage.Properties["EPLAN.Page.UserSupplementaryField11"] = string.Format("UserSupplementaryField11@{0}", DateTime.Now.ToString());
                targetPage.Properties[11901, 21] = string.Format("SupplementaryField[21]@{0}", DateTime.Now.ToString());

                MessageDisplayHelper.Show("Set Properties Completed!", "::: Set Page Properties");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Set Properties Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Set Page Properties", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #21
0
        private void ApiExtSampleForm_Shown(object sender, EventArgs e)
        {
            try
            {
                if (this._logger.IsDebugEnabled)
                {
                    this._logger.DebugFormat("ApiExtSampleForm_Shown(), ProjectLinkFilePath=[{0}]", ProjectHelper.GetCurrentProject().ProjectLinkFilePath);
                }

                this.txtProject.Text = ProjectHelper.GetCurrentProject().ProjectLinkFilePath;
            }
            catch (Exception ex)
            {
                if (this._logger.IsErrorEnabled)
                {
                    this._logger.Error(string.Format("ApiExtSampleForm_Shown(), ex=[{0}]", ex.Message), ex);
                }

                MessageDisplayHelper.Show(ex.Message, "::: API Samples", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #22
0
        private void btnProjectSetProperties_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProject))
            {
                return;
            }

            try
            {
                Project targetProject = ProjectHelper.GetProject(this.txtProject.Text);

                targetProject.Properties[10013] = Path.GetFileNameWithoutExtension(this.txtProject.Text); // Job Number
                targetProject.Properties["EPLAN.Project.UserSupplementaryField1"] = string.Format("UserSupplementaryField1@{0}", DateTime.Now.ToString());
                targetProject.Properties[10901, 11] = string.Format("SupplementaryField[11]@{0}", DateTime.Now.ToString());

                MessageDisplayHelper.Show("Set Properties Completed!", "::: Set Project Properties");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Set Properties Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Set Project Properties", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #23
0
        private void btnPartShowUsageInPage_Click(object sender, EventArgs e)
        {
            if (!ValidatePageSelected(this.cBoxPartPages))
            {
                return;
            }

            try
            {
                ISOCode guiLang    = ApiExtHelpers.GetEplanGUILanguage();
                Page    targetPage = ((EplanPageViewModel)this.cBoxPartPages.SelectedItem).Page;

                foreach (var function in targetPage.Functions)
                {
                    foreach (var partReference in function.ArticleReferences)
                    {
                        Article part = partReference.Article;

                        StringBuilder propertyText = new StringBuilder();
                        propertyText.AppendFormat("partReference.PartNr [{1}]{0}{0}", Environment.NewLine, partReference.PartNr);

                        if (part != null)
                        {
                            propertyText.AppendFormat("part.Properties.ARTICLE_DESCR1 = [{1}]{0}{0}", Environment.NewLine, part.Properties.ARTICLE_DESCR1.IsEmpty ? string.Empty : part.Properties.ARTICLE_DESCR1.ToString());
                            propertyText.AppendFormat("part.Properties.ARTICLE_DESCR2 = [{1}]{0}{0}", Environment.NewLine, part.Properties.ARTICLE_DESCR2.IsEmpty ? string.Empty : part.Properties.ARTICLE_DESCR2.ToString());
                            propertyText.AppendFormat("part.Properties.ARTICLE_DESCR3 = [{1}]{0}{0}", Environment.NewLine, part.Properties.ARTICLE_DESCR2.IsEmpty ? string.Empty : part.Properties.ARTICLE_DESCR2.ToString());

                            propertyText.AppendFormat("part.Properties.ARTICLE_NOTE = [{1}]{0}{0}", Environment.NewLine, part.Properties.ARTICLE_NOTE.IsEmpty ? string.Empty : part.Properties.ARTICLE_NOTE.ToString());
                        }

                        MessageDisplayHelper.Show(propertyText.ToString(), string.Format("[{0}] 속성", partReference.PartNr));
                    }
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Page Part Liist Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Part Page List", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #24
0
        private void btnPageReadProperties_Click(object sender, EventArgs e)
        {
            if (!ValidatePageSelected(this.cBoxPagePages))
            {
                return;
            }

            try
            {
                ISOCode guiLang    = ApiExtHelpers.GetEplanGUILanguage();
                Page    targetPage = ((EplanPageViewModel)this.cBoxPagePages.SelectedItem).Page;

                StringBuilder propertyText = new StringBuilder();
                propertyText.AppendFormat("Page [{1}] Properties{0}{0}", Environment.NewLine, targetPage.Name);

                propertyText.AppendFormat("PageType = [{1}]{0}", Environment.NewLine, targetPage.PageType);
                propertyText.AppendFormat("PageTypeName = [{1}]{0}{0}", Environment.NewLine, targetPage.PageTypeName);

                propertyText.AppendFormat("EPLAN.Page.UserSupplementaryField11 = [{1}]{0}{0}", Environment.NewLine, targetPage.Properties["EPLAN.Page.UserSupplementaryField11"]);

                propertyText.AppendFormat("SupplementaryField[21]{0}", Environment.NewLine);
                propertyText.AppendFormat(" ToString() = [{1}]{0}", Environment.NewLine, targetPage.Properties[11901, 21]);
                propertyText.AppendFormat(" ToString(Lang) = [{1}]{0}", Environment.NewLine, targetPage.Properties[11901, 21].ToString(guiLang.GetNumber()));
                propertyText.AppendFormat(" ToMultiLangString().GetStringToDisplay(Lang) = [{1}]{0}{0}", Environment.NewLine, targetPage.Properties[11901, 21].ToMultiLangString().GetStringToDisplay(guiLang.GetNumber()));

                propertyText.AppendFormat("Page Description{0}", Environment.NewLine);
                propertyText.AppendFormat(" ToString() = [{1}]{0}", Environment.NewLine, targetPage.Properties.PAGE_NOMINATIOMN);
                propertyText.AppendFormat(" ToString(Lang) = [{1}]{0}", Environment.NewLine, targetPage.Properties.PAGE_NOMINATIOMN.ToString(guiLang.GetNumber()));
                propertyText.AppendFormat(" ToMultiLangString().GetStringToDisplay(Lang) = [{1}]{0}", Environment.NewLine, targetPage.Properties.PAGE_NOMINATIOMN.ToMultiLangString().GetStringToDisplay(guiLang.GetNumber()));


                MessageDisplayHelper.Show(propertyText.ToString(), "::: Read Project Properties");
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Read Properties Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Read Project Properties", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #25
0
        private void btnProjectExportPDF_Click(object sender, EventArgs e)
        {
            if (!ValidateProjectSelected(this.txtProject))
            {
                return;
            }

            try
            {
                using (Export pdfExport = new Export())
                {
                    string pdfFileName = string.Format("{0}_{1}.pdf", Path.GetFileNameWithoutExtension(this.txtProject.Text), DateTime.Now.ToString("yyMMdd.HHmmssfff"));
                    string pdfFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "EPLANApiExt", pdfFileName);

                    pdfExport.PdfProject(ProjectHelper.GetProject(this.txtProject.Text), "EPLAN_default_value", pdfFullPath, Export.DegreeOfColor.Color, this.checkBoxPageInclude3D.Checked, string.Empty, true);

                    MessageDisplayHelper.Show("PDF Export Completed!", "::: Export PDF");
                }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("PDF Export Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Export PDF", EnumDecisionIcon.eEXCLAMATION);
            }
        }
Example #26
0
 /// <summary>
 /// 消息处理
 /// </summary>
 /// <param name="eventMessage"></param>
 public void Event(string eventMessage)
 {
     MessageDisplayHelper.Event(eventMessage, lstMessages);
 }
 void tttt_Handler(object sender, EventArgs e)
 {
     MessageDisplayHelper.Event(sender.ToString(), this.listBox1);
 }
Example #28
0
        /// <summary>
        /// Execution of the Action.
        /// </summary>
        /// <returns>True:  Execution of the Action was successful</returns>
        public bool Execute(ActionCallingContext ctx)
        {
            MessageDisplayHelper.Show("ActionApiExtPopupMenu was called", "ActionApiExtPopupMenu");

            return(true);
        }
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <param name="msg"></param>
 public void WriteMessage(string msg)
 {
     MessageDisplayHelper.Event(msg, listBox3);
 }
Example #30
0
        private void btnPage2Create_Click(object sender, EventArgs e)
        {
            #region Validation

            if (!ValidateProjectSelected(this.txtProject))
            {
                return;
            }

            if (!ValidateProjectSelected(this.txtPage2PageName))
            {
                MessageDisplayHelper.Show("Please Input Page Name!", "::: Page Create");
                this.txtPage2PageName.Focus();
                return;
            }

            if (!ValidateProjectSelected(this.txtPage2Description))
            {
                MessageDisplayHelper.Show("Please Input Page Description!", "::: Page Create");
                this.txtPage2Description.Focus();
                return;
            }

            #endregion

            try
            {
                using (Project targetProject = ProjectHelper.GetProject(this.txtProject.Text))
                    using (PagePropertyList properties = new PagePropertyList())
                    {
                        if (!string.IsNullOrWhiteSpace(this.txtPage2HLF.Text))
                        {
                            properties.DESIGNATION_PLANT = this.txtPage2HLF.Text.Trim();
                        }
                        if (!string.IsNullOrWhiteSpace(this.txtPage2ML.Text))
                        {
                            properties.DESIGNATION_LOCATION = this.txtPage2ML.Text.Trim();
                        }
                        if (!string.IsNullOrWhiteSpace(this.txtPage2PageName.Text))
                        {
                            properties.PAGE_COUNTER = this.txtPage2PageName.Text.Trim();
                        }

                        Page[] resultPages = SerachByFullPageName(ProjectHelper.GetProject(this.txtProject.Text), BulidSearchPageName(properties));

                        if (resultPages.Length > 0)
                        {
                            DeletePage(resultPages);
                        }

                        CreatePage(targetProject, properties, string.IsNullOrWhiteSpace(this.txtPage2Description.Text) ? string.Empty : this.txtPage2Description.Text.Trim(), DocumentType.Circuit);
                        RefreshProjectPages(this.cBoxPageCreatePages);

                        MessageDisplayHelper.Show("Page Created!", "::: Page Create");
                    }
            }
            catch (Exception ex)
            {
                MessageDisplayHelper.Show(string.Format("Create Page Failed!{0}{1}", Environment.NewLine, ex.Message), "::: Page Create", EnumDecisionIcon.eEXCLAMATION);
            }
        }