コード例 #1
0
        public CADWorkStationInfo Load(int language)
        {
            if (language == 1)
            {
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
                Application.EnableVisualStyles();
            }

            if (this.formCADTaskServer == null)
            {
                this.formCADTaskServer                    = new FormCADTaskServer();
                this.formCADTaskServer.Closed            += this.formCADTaskServer_Closed;
                this.formCADTaskServer.GetNewCADTask     += this.formCADTaskServer_GetCADTask;
                this.formCADTaskServer.AutoGetNewCADTask += this.formCADTaskServer_AutoGetNewCADTask;
                this.formCADTaskServer.CovertHandGet     += this.formCADTaskServer_CovertHandGet;
                this.formCADTaskServer.Show();
                this.workStationInfo = new CADWorkStationInfo();
                this.isLoad          = true;

                if (this.formCADTaskServer.WsInfo == null)
                {
                    this.workStationInfo.IsLoad = false;
                }
                else
                {
                    this.workStationInfo.IsLoad       = true;
                    this.workStationInfo.GetTaskCycle = this.formCADTaskServer.WsInfo.GetTaskCycle;

                    this.workStationInfo.PdsPath                    = this.formCADTaskServer.ServiceConfigInfo.PdsPath;
                    this.workStationInfo.WorkPath                   = this.formCADTaskServer.ServiceConfigInfo.WorkPath;
                    this.workStationInfo.DakPath                    = this.formCADTaskServer.ServiceConfigInfo.BakPath;
                    this.workStationInfo.nFontStrokeMode            = this.formCADTaskServer.ServiceConfigInfo.nFontStrokeMode;
                    this.workStationInfo.bRebuildBaseMode           = this.formCADTaskServer.ServiceConfigInfo.bRebuildBaseMode;
                    this.workStationInfo.bRebuildBaseModelInstTable = this.formCADTaskServer.ServiceConfigInfo.bRebuildBaseModelInstTable;
                    this.workStationInfo.bRebuildNewInst            = this.formCADTaskServer.ServiceConfigInfo.bRebuildNewInst;
                    this.workStationInfo.bIsBackupModel             = this.formCADTaskServer.ServiceConfigInfo.bIsBackupModel;
                    this.workStationInfo.bMakeDRW                   = this.formCADTaskServer.ServiceConfigInfo.bMakeDRW;
                    this.workStationInfo.bMakeDWG                   = this.formCADTaskServer.ServiceConfigInfo.bMakeDWG;
                    this.workStationInfo.bMakeDXF                   = this.formCADTaskServer.ServiceConfigInfo.bMakeDXF;
                    this.workStationInfo.bMakePDF                   = this.formCADTaskServer.ServiceConfigInfo.bMakePDF;
                    this.workStationInfo.nSelectTemplateId          = this.formCADTaskServer.ServiceConfigInfo.nSelectTemplateId;
                    this.StartCADWCF(this, this.formCADTaskServer.ServiceConfigInfo.WCFCADServer);

                    // 计时器
                    this.GetTaskTimer.Interval             = this.formCADTaskServer.WsInfo.GetTaskCycle * 1000;
                    this.GetTaskTimer.Elapsed             += this.GetTaskTimer_Elapsed;
                    this.GetTaskTimerOnTaskRunEnd.Interval = 5000;
                    this.GetTaskTimerOnTaskRunEnd.Elapsed += this.GetTaskTimerOnTaskRunEnd_Elapsed;

                    return(this.workStationInfo);
                }
            }
            return(this.workStationInfo);
        }
コード例 #2
0
        public void UnLoad()
        {
            if (this.formCADTaskServer != null)
            {
                try
                {
                    this.GetTaskTimer.Close();
                    this.GetTaskTimerOnTaskRunEnd.Close();

                    this.formCADTaskServer.Close();
                    this.formCADTaskServer = null;
                    if (this.host != null)
                    {
                        this.host.Close();
                    }
                }
                catch (Exception ex)
                {
                    this.formCADTaskServer.SentLogErrorMessage(ex.Message + ex.StackTrace);
                }
            }
        }