Example #1
0
        private void frmClose_Load(object sender, EventArgs e)
        {
            rm = new ResourceManager("SoukeyNetget.Resources.globalUI", Assembly.GetExecutingAssembly());

            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                if (Config.ExitSelected == 0)
                {
                    this.raMin.Checked = true;
                }
                else
                {
                    this.raExit.Checked = true;
                }

                if (Config.ExitIsShow == true)
                {
                    this.checkBox1.Checked = false;
                }
                else
                {
                    this.checkBox1.Checked = true;
                }

                Config = null;
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
 //±£´æÅäÖÃÐÅÏ¢
 private void SaveConfigData()
 {
     try
     {
         cXmlSConfig Config = new cXmlSConfig();
         if (this.raMin.Checked == true)
         {
             Config.ExitSelected = 0;
         }
         else
         {
             Config.ExitSelected = 1;
         }
         if (this.checkBox1.Checked == true)
         {
             Config.ExitIsShow = false;
         }
         else
         {
             Config.ExitIsShow = true;
         }
         Config = null;
     }
     catch (System.Exception)
     {
         MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #3
0
        //±£´æÅäÖÃÐÅÏ¢
        private void SaveConfigData()
        {
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                Config.IsInstantSave = false;

                if (this.raMin.Checked == true)
                {
                    Config.ExitSelected = 0;
                }
                else
                {
                    Config.ExitSelected = 1;
                }

                if (this.checkBox1.Checked == true)
                {
                    Config.ExitIsShow = true;
                }
                else
                {
                    Config.ExitIsShow = false;
                }

                if (this.IsAutoSystemLog.Checked == true)
                {
                    Config.AutoSaveLog = true;
                }
                else
                {
                    Config.AutoSaveLog = false;
                }

                if (this.comUILanguage.SelectedIndex == 0)
                {
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.Auto;
                }
                else if (this.comUILanguage.SelectedIndex == 1)
                {
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.enUS;
                }
                else if (this.comUILanguage.SelectedIndex == 2)
                {
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.zhCN;
                }

                Config.Save();

                Config = null;

                this.IsSave.Text = "false";
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void frmConfig_Load(object sender, EventArgs e)
        {
            rm = new ResourceManager("SoukeyNetget.Resources.globalUI", Assembly.GetExecutingAssembly());

            this.comUILanguage.Items.Add(rm.GetString ("Label24"));
            this.comUILanguage.Items.Add(rm.GetString("Label25"));
            this.comUILanguage.Items.Add(rm.GetString("Label26"));

            this.txtLogPath.Text = Program.getPrjPath() + "log";

            try
            {
                cXmlSConfig Config = new cXmlSConfig();

                if (Config.ExitSelected == 0)
                    this.raMin.Checked = true;
                else
                    this.raExit.Checked = true;

                if (Config.ExitIsShow == true)
                    this.checkBox1.Checked = true;
                else
                    this.checkBox1.Checked = false;

                this.IsAutoSystemLog.Checked = Config.AutoSaveLog;

                switch (Config.CurrentLanguage)
                {
                    case cGlobalParas.CurLanguage .Auto :
                        this.comUILanguage.SelectedIndex = 0;
                        break;
                    case cGlobalParas.CurLanguage .enUS :
                        this.comUILanguage.SelectedIndex=1;
                        break ;
                    case cGlobalParas.CurLanguage .zhCN :
                        this.comUILanguage.SelectedIndex =2;
                        break;
                    default :
                        break ;
                }

                Config = null;

                this.cmdApply.Enabled = false;
                this.IsSave.Text = "false";

            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
        static void Main()
        {
            //检测是否指定了界面语言
            CultureInfo cLanguage = null;

            try
            {
                cXmlSConfig Config          = new cXmlSConfig();
                cGlobalParas.CurLanguage cl = Config.CurrentLanguage;
                switch (cl)
                {
                case cGlobalParas.CurLanguage.Auto:
                    break;

                case cGlobalParas.CurLanguage.enUS:
                    cLanguage = new CultureInfo("en-US");
                    break;

                case cGlobalParas.CurLanguage.zhCN:
                    cLanguage = new CultureInfo("zh-CN");
                    break;

                default:
                    break;
                }
                Config = null;
            }
            catch (System.Exception)
            {
            }

            if (cLanguage != null)
            {
                Thread.CurrentThread.CurrentUICulture = cLanguage;
                Thread.CurrentThread.CurrentCulture   = cLanguage;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frmStart sf = new frmStart();

            sf.Show();
            context           = new ApplicationContext();
            context.Tag       = sf;
            Application.Idle += new EventHandler(Application_Idle); //注册程序运行空闲去执行主程序窗体相应初始化代码
            Application.Run(context);
        }
        static void Main()
        {
            //检测是否指定了界面语言
            CultureInfo cLanguage=null ;

            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                cGlobalParas.CurLanguage cl=Config.CurrentLanguage ;
                switch (cl)
                {
                    case cGlobalParas.CurLanguage .Auto :
                        break ;
                    case cGlobalParas.CurLanguage .enUS :
                       cLanguage =new CultureInfo ("en-US");
                        break ;
                    case cGlobalParas.CurLanguage .zhCN :
                        cLanguage =new CultureInfo ("zh-CN");
                        break ;
                    default :
                        break ;
                }
                Config = null;
            }
            catch (System.Exception)
            {

            }

            if (cLanguage != null)
            {
                Thread.CurrentThread.CurrentUICulture = cLanguage;
                Thread.CurrentThread.CurrentCulture = cLanguage;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frmStart sf = new frmStart();
            sf.Show();
            context = new ApplicationContext();
            context.Tag = sf;
            Application.Idle += new EventHandler(Application_Idle); //注册程序运行空闲去执行主程序窗体相应初始化代码
            Application.Run(context);
        }
        private void frmClose_Load(object sender, EventArgs e)
        {
            rm = new ResourceManager("SoukeyNetget.Resources.globalUI", Assembly.GetExecutingAssembly());

            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                if (Config.ExitSelected == 0)
                    this.raMin.Checked = true;
                else
                    this.raExit.Checked = true;

                if (Config.ExitIsShow == true)
                    this.checkBox1.Checked = false;
                else
                    this.checkBox1.Checked = true;

                Config = null;
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 //����������Ϣ
 private void SaveConfigData()
 {
     try
     {
         cXmlSConfig Config = new cXmlSConfig();
         if (this.raMin.Checked == true)
             Config.ExitSelected = 0;
         else
             Config.ExitSelected = 1;
         if (this.checkBox1.Checked == true)
             Config.ExitIsShow = false;
         else
             Config.ExitIsShow = true;
         Config = null;
     }
     catch (System.Exception)
     {
         MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        //�˷�����Ҫ�dz�ʼ��ϵͳ����,������Ҫ��ʼ����Ϣ�¼�,��ʼ���ɼ�
        //���������,������������������,���������������,���ʼ��һ����
        //�Ķ���
        public void UserIni()
        {
            //��ʼ��һ���ɼ�����Ŀ�����,�ɼ������ɴ˿�����������ɼ�����
            //����
            m_GatherControl = new cGatherControl();

            //�ɼ��������¼���,�󶨺�,ҳ�������Ӧ�ɼ����������¼�
            m_GatherControl.TaskManage.TaskCompleted += tManage_Completed;
            m_GatherControl.TaskManage.TaskStarted += tManage_TaskStart;
            m_GatherControl.TaskManage.TaskInitialized += tManage_TaskInitialized;
            m_GatherControl.TaskManage.TaskStateChanged += tManage_TaskStateChanged;
            m_GatherControl.TaskManage.TaskStopped += tManage_TaskStop;
            m_GatherControl.TaskManage.TaskError += tManage_TaskError;
            m_GatherControl.TaskManage.TaskFailed += tManage_TaskFailed;
            m_GatherControl.TaskManage.TaskAborted += tManage_TaskAbort;
            m_GatherControl.TaskManage.Log += tManage_Log;
            m_GatherControl.TaskManage.GData += tManage_GData;

            m_GatherControl.TaskManage.RunTask += this.On_RunSoukeyTask;

            m_GatherControl.Completed += m_Gather_Completed;

            //����������������,��������������Ҫ�Ǹ���taskrun.xml(Ĭ����Tasks\\TaskRun.xml)�ļ���
            //�����ݽ��м���,

            //�����ж�TaskRun.xml�ļ��Ƿ����,����������һ��
            if (!System.IO.File.Exists(Program.getPrjPath() + "Tasks\\taskrun.xml"))
            {
                CreateTaskRun();
            }

            cTaskDataList gList = new cTaskDataList();

            //���ݼ��ص���������������Ϣ,��ʼ��ʼ���ɼ�����
            try
            {
                gList.LoadTaskRunData();
                bool IsAddRTaskSucceed=m_GatherControl.AddGatherTask(gList);

                if (IsAddRTaskSucceed==false )
                    MessageBox.Show(rm.GetString("Error23") , rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error);

            }
            catch (System.Exception ex)
            {
                MessageBox.Show(rm.GetString("Error15") + ex.Message, rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            //��ʼ�������ڵ�����������Ϣ
            m_PublishControl = new cPublishControl();

            //ע�ᷢ��������¼�
            m_PublishControl.PublishManage.PublishCompleted += this.Publish_Complete;
            m_PublishControl.PublishManage.PublishError += this.Publish_Error;
            m_PublishControl.PublishManage.PublishFailed += this.Publish_Failed;
            m_PublishControl.PublishManage.PublishStarted  += this.Publish_Started;
            m_PublishControl.PublishManage.PublishTempDataCompleted += this.Publish_TempDataCompleted;
            m_PublishControl.PublishManage.PublishLog += this.Publish_Log;
            m_PublishControl.PublishManage.RunTask += On_RunSoukeyTask;

            //����ѡ��ġ��������С����νڵ㣬������Ӧ����Ϣ
            try
            {
                LoadRunTask();
            }
            catch (System.IO.IOException)
            {
                if (MessageBox.Show(rm.GetString("Quaere3"), rm.GetString ("MessageboxQuaere"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    CreateTaskRun();
                }
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString ("Error16"),rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            SetDataShow();

            //�����Ƿ��Զ�����ϵͳ��־��־
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                m_IsAutoSaveLog = Config.AutoSaveLog;
                Config = null;
            }
            catch (System.Exception)
            {
                //��ʾ�����ļ����������Ҫ��������
            }

            //���ʱ�������ڸ���������ʾ�Ľ���
            this.timer1.Enabled = true;

            //����״̬����Ϣ
            UpdateStatebarTask();
        }
        private void toolmenuEnglish_Click(object sender, EventArgs e)
        {
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                Config.CurrentLanguage = cGlobalParas.CurLanguage.enUS;
                Config = null;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show (ex.Message ,rm.GetString ("MessageboxError"),MessageBoxButtons.OK ,MessageBoxIcon.Error );
                return ;
            }

            this.toolmenuAuto.Checked = false;
            this.toolmenuEnglish.Checked = true;
            this.toolmenuCHS.Checked = false;

            MessageBox.Show(rm.GetString("Info113"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        //�˷�����Ҫ���н����ʼ���IJ������޲���
        //�˷�����Ҫ�dz�ʼ��������ʾ������,����
        //���νṹ,Ĭ�Ͻڵ�,��ҳ��Ĭ�ϵ�ҳ��ȵ�
        public void IniForm()
        {
            this.treeMenu.ExpandAll();
            TreeNode newNode;
            int i = 0;

            //д��־�����ʱ��
            ExportLog(DateTime.Now + "��" + rm.GetString("InfoStart"));

            //����datagridview���ش�����Ϣ����ʵ��ʽ
            SetRowErrStyle();

            //����Tooltip��Ϣ
            SetToolTip();

            //��ʼ����ҳ���̶���ַ��������ת�ɴ�ҳ��������
            this.webBrowser.Navigate("http://www.yijie.net/softini.html");

            try
            {
                //��ʼ��ʼ�����νṹ,ȡxml�е�����,��ȡ�������
                Task.cTaskClass xmlTClass = new Task.cTaskClass();

                int TClassCount = xmlTClass.GetTaskClassCount();

                for (i = 0; i < TClassCount; i++)
                {
                    newNode = new TreeNode();
                    newNode.Tag = xmlTClass.GetTaskClassPathByID(xmlTClass.GetTaskClassID(i));
                    newNode.Name = "C" + xmlTClass.GetTaskClassID(i);
                    newNode.Text = xmlTClass.GetTaskClassName(i);
                    newNode.ImageIndex = 0;
                    newNode.SelectedImageIndex = 0;
                    //this.treeMenu.SelectedNode = newNode;
                    this.treeMenu.Nodes["nodTaskClass"].Nodes.Add(newNode);
                    newNode = null;
                }
                xmlTClass = null;
            }
            catch (System.Exception )
            {
                MessageBox.Show(rm.GetString ("Error14"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);

            }

            //���ݵ�ǰ��ʾ�����ԣ����ò˵���Ĭ��ѡ��
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                cGlobalParas.CurLanguage cl = Config.CurrentLanguage;
                switch (cl)
                {
                    case cGlobalParas.CurLanguage.Auto:
                        this.toolmenuAuto.Checked = true;
                        break;
                    case cGlobalParas.CurLanguage.enUS:
                        this.toolmenuAuto.Checked = false;
                        this.toolmenuEnglish.Checked = true;
                        this.toolmenuCHS.Checked = false;
                        break;
                    case cGlobalParas.CurLanguage.zhCN:
                        this.toolmenuAuto.Checked = false;
                        this.toolmenuCHS.Checked = true;
                        this.toolmenuEnglish.Checked = false;
                        break;
                    default:
                        break;
                }
                Config = null;
            }
            catch (System.Exception)
            {

            }

            //��������ڵ㸳·��ֵ
            this.treeMenu.Nodes["nodTaskClass"].Tag = Program.getPrjPath() + "Tasks";

            //����Ĭ��ѡ������νṹ�ڵ�Ϊ���������С�
            TreeNode SelectNode = new TreeNode();
            SelectNode = this.treeMenu.Nodes[0].Nodes[0];
            this.treeMenu.SelectedNode = SelectNode;
            SelectNode = null;

            //����ɾ����Ϊ���νṹ
            DelName = this.treeMenu.Name;
        }
        private void frmMain_Load(object sender, EventArgs e)
        {
            cXmlSConfig m_config=null;

            //��ʼ������������Ϣ
            try
            {
                m_config = new cXmlSConfig();

                if (m_config.IsFirstRun == true)
                {
                    frmHelpInfo fh = new frmHelpInfo();
                    fh.ShowDialog();
                    fh.Dispose();
                    fh = null;
                    m_config.IsFirstRun = false;
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(rm.GetString ("Info61") + ex.Message, rm.GetString("MessageboxError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            m_config = null;
        }
        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            cXmlSConfig m_config=null;

            //��ʼ������������Ϣ
            try
            {
                m_config = new cXmlSConfig();
                if (m_config.ExitIsShow == true)
                {
                    frmClose fc = new frmClose();
                    fc.RExitPara = new frmClose.ReturnExitPara(GetExitPara);
                    if (fc.ShowDialog() == DialogResult.Cancel)
                    {
                        fc.Dispose();
                        e.Cancel = true;
                        return;
                    }
                    else
                    {
                        if (m_ePara == cGlobalParas.ExitPara.MinForm)
                        {
                            fc.Dispose();
                            e.Cancel = true;
                            this.Hide();
                            return;
                        }
                    }
                }
                else
                {
                    //�ж���ֱ���˳�������С������
                    if (m_config.ExitSelected == 0)
                    {
                        this.Hide();
                        e.Cancel = true;
                        return;
                    }
                }

                m_config = null;
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString ("Info40"), rm.GetString ("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);

                frmClose fc = new frmClose();
                fc.RExitPara = new frmClose.ReturnExitPara(GetExitPara);
                if (fc.ShowDialog() == DialogResult.Cancel)
                {
                    fc.Dispose();
                    e.Cancel = true;
                    return;
                }
                else
                {
                    if (m_ePara == cGlobalParas.ExitPara.MinForm)
                    {
                        fc.Dispose();
                        e.Cancel = true;
                        this.Hide();
                        return;
                    }
                }
            }

            //�ж��Ƿ�������е�����
            if (m_GatherControl.TaskManage.TaskListControl.RunningTaskList.Count != 0)
            {
                if (MessageBox.Show(rm.GetString("Quaere13"), rm.GetString ("MessageboxQuaere"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    e.Cancel = true;
                    return;
                }
                else
                {
                    while (m_GatherControl.TaskManage.TaskListControl.RunningTaskList.Count > 0)
                    {
                        Int64 TaskID=m_GatherControl.TaskManage.TaskListControl.RunningTaskList[0].TaskID ;

                        //�����¼�����
                        m_GatherControl.TaskManage.TaskEventDispose(m_GatherControl.TaskManage.TaskListControl.RunningTaskList[0]);

                        m_GatherControl.Abort(m_GatherControl.TaskManage.TaskListControl.RunningTaskList[0]);

                        SaveGatherTempData(TaskID);
                    }
                }
            }

            //��ʼ���ٹ��ڲɼ����񼰷��������������Դ
            m_GatherControl.Dispose();
            m_PublishControl.Dispose();
        }
Example #14
0
        private void frmConfig_Load(object sender, EventArgs e)
        {
            rm = new ResourceManager("SoukeyNetget.Resources.globalUI", Assembly.GetExecutingAssembly());

            this.comUILanguage.Items.Add(rm.GetString("Label24"));
            this.comUILanguage.Items.Add(rm.GetString("Label25"));
            this.comUILanguage.Items.Add(rm.GetString("Label26"));

            this.txtLogPath.Text = Program.getPrjPath() + "log";

            try
            {
                cXmlSConfig Config = new cXmlSConfig();

                if (Config.ExitSelected == 0)
                {
                    this.raMin.Checked = true;
                }
                else
                {
                    this.raExit.Checked = true;
                }

                if (Config.ExitIsShow == true)
                {
                    this.checkBox1.Checked = true;
                }
                else
                {
                    this.checkBox1.Checked = false;
                }

                this.IsAutoSystemLog.Checked = Config.AutoSaveLog;

                switch (Config.CurrentLanguage)
                {
                case cGlobalParas.CurLanguage.Auto:
                    this.comUILanguage.SelectedIndex = 0;
                    break;

                case cGlobalParas.CurLanguage.enUS:
                    this.comUILanguage.SelectedIndex = 1;
                    break;

                case cGlobalParas.CurLanguage.zhCN:
                    this.comUILanguage.SelectedIndex = 2;
                    break;

                default:
                    break;
                }

                Config = null;

                this.cmdApply.Enabled = false;
                this.IsSave.Text      = "false";
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //����������Ϣ
        private void SaveConfigData()
        {
            try
            {
                cXmlSConfig Config = new cXmlSConfig();
                Config.IsInstantSave = false;

                if (this.raMin.Checked == true)
                    Config.ExitSelected = 0;
                else
                    Config.ExitSelected = 1;

                if (this.checkBox1.Checked == true)
                    Config.ExitIsShow = true;
                else
                    Config.ExitIsShow = false;

                if (this.IsAutoSystemLog.Checked == true)
                    Config.AutoSaveLog = true;
                else
                    Config.AutoSaveLog = false;

                if (this.comUILanguage.SelectedIndex == 0)
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.Auto;
                else if (this.comUILanguage.SelectedIndex == 1)
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.enUS;
                else if (this.comUILanguage.SelectedIndex == 2)
                    Config.CurrentLanguage = cGlobalParas.CurLanguage.zhCN;

                Config.Save();

                Config = null;

                this.IsSave.Text = "false";
            }
            catch (System.Exception)
            {
                MessageBox.Show(rm.GetString("Info76"), rm.GetString("MessageboxInfo"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }