Ejemplo n.º 1
0
 private DataCollectArgs ReadArgs(string argFile)
 {
     string[] contexts = File.ReadAllLines(argFile, Encoding.Default);
     if (contexts == null || contexts.Length < 7)
     {
         return(null);
     }
     _collectArgs                 = new DataCollectArgs();
     _collectArgs.ProIdentify     = contexts[0];
     _collectArgs.SubProCatalogCN = contexts[1];
     _collectArgs.WorkspaceDir    = contexts[2];
     _collectArgs.OutDirRoot      = contexts[3];
     _collectArgs.isRemove        = bool.Parse(contexts[4]);
     _collectArgs.isCyctime       = bool.Parse(contexts[5]);
     _collectArgs.Cyctime         = contexts[6];
     return(_collectArgs);
 }
Ejemplo n.º 2
0
        private void InitFrm()
        {
            if (File.Exists(_argFile))
            {
                _collectArgs = ReadArgs(_argFile);
            }
            _proDic = CatalogCNHelper.GetDic();
            //初始化产品列表
            if (_proDic.Count != 0)
            {
                cbProduct.Items.AddRange(_proDic.Keys.ToArray());
                if (_collectArgs != null && _proDic.ContainsKey(_collectArgs.ProIdentify))
                {
                    cbProduct.Text = _collectArgs.ProIdentify;
                }
                else
                {
                    cbProduct.SelectedIndex = 0;
                }
            }
            //初始化工作空间
            if (_collectArgs != null && !string.IsNullOrEmpty(_collectArgs.WorkspaceDir))
            {
                txtWorksapce.Text = _collectArgs.WorkspaceDir;
            }
            else
            {
                MifConfig config = new MifConfig();
                txtWorksapce.Text = config.GetConfigValue("Workspace");
            }

            //初始化输出目录
            if (_collectArgs != null)
            {
                txtOutdir.Text = _collectArgs.OutDirRoot;
            }

            if (_collectArgs != null)
            {
                ckRemove.Checked = _collectArgs.isRemove;
            }
        }