/// <summary>
        /// Instanciates and fills a new information list.
        /// </summary>
        /// <param name="prefix">The prefix.</param>
        /// <param name="data">The data, either as InfoList.InfoData, or in pairs of name, data.</param>
        /// <returns>
        /// A new information list.
        /// </returns>
        public static InfoList List(string prefix, params object[] data)
        {
            InfoList info = new InfoList(prefix);

            object[] objects;
            if (data.Length == 1 && data[0] is object[] && (data[0] as object[]).Length > 0)
            {
                objects = data[0] as object[];
            }
            else
            {
                objects = data;
            }

            for (int i = 0; i < objects.Length; i++)
            {
                if (objects[i] is InfoList.InfoData)
                {
                    info.Add((InfoList.InfoData)objects[i]);
                }
                else if (i == objects.Length - 1)
                {
                    info.Add(null, objects[i]);
                }
                else
                {
                    info.Add(ObjectToString(objects[i]), objects[i + 1]);
                    i++;
                }
            }

            return(info);
        }
Beispiel #2
0
 public void Add(string assetFullName, AssetInfo asset)
 {
     Init();
     NameList.Add(assetFullName);
     InfoList.Add(asset);
     EditorUtility.SetDirty(this);
 }
Beispiel #3
0
 public void AddInfo(string message)
 {
     InfoList.Add(new Info
     {
         Message = message
     });
 }
Beispiel #4
0
 public ExecutionResult AddInfo(string intel)
 {
     if (InfoList == null)
     {
         InfoList = new List <string>();
     }
     InfoList.Add(intel);
     return(this);
 }
Beispiel #5
0
 public void SetStationList(params StationBase[] stations)
 {
     foreach (var it in stations)
     {
         InfoList.Add(new StationInfoModel()
         {
             StationName = it.StationName,
         });
     }
 }
Beispiel #6
0
 private void InitFileList(List <UpdateRuleParameter> list, string appendix)
 {
     foreach (var item in list)
     {
         RuleFileInfo file = new RuleFileInfo(item.Type)
         {
             Appendix = appendix,
             CarType  = item.CarType,
             Standard = item.Standard,
             Version  = _SelectedFillRuleVersion
         };
         System.IO.FileInfo info = new System.IO.FileInfo(item.FileName);
         file.OriginName = info.Name;
         _Items.Add(file);
     }
 }
Beispiel #7
0
        private void ChangeEnterprise(object state)
        {
            IsUploading = true;
            _AppFiles.CloseNotifycation();
            try
            {
                Version serverVersion = new Version(ServiceHelper.GetAppVersion(_SelectedEnterprise));
                List <AssistantUpdater.AppFileInfo> list = ServiceHelper.GetAllFiles(_SelectedEnterprise, serverVersion.ToString());
                Version version = FileHelper.GetCurrentVersion();

                foreach (var item in list)
                {
                    AppFileInfo file = new AppFileInfo()
                    {
                        ServerVersion = serverVersion,
                        Version       = version,
                        Enterprise    = _SelectedEnterprise,
                        Status        = item.IsDeleted ? FileStatus.Deleted : FileStatus.Uploaded,
                        OriginName    = item.fileName
                    };
                    _AppFiles.Add(file);
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.Application.OpenForms[0].Invoke((Action)(() =>
                {
                    System.Windows.Forms.MessageBox.Show(ex.Message, "错误", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }));
            }
            finally
            {
                IsUploading = false;
                System.Windows.Forms.Application.OpenForms[0].Invoke((Action)(() =>
                {
                    _AppFiles.OpenNotifycation(true);
                }));
            }
        }
Beispiel #8
0
 private void GetResults()
 {
     if (!string.IsNullOrEmpty(_queryInput) && !string.IsNullOrWhiteSpace(_queryInput))
     {
         InfoList.Clear();
         var query   = new Query();
         var results = query.GetSearchResult(_queryInput, _selectedEngine);
         if (results != null && results.Any())
         {
             foreach (var r in results)
             {
                 var model = new DisplayModel()
                 {
                     RelatedKey  = r.RelatedKey,
                     Description = r.Description,
                     Url         = r.Url,
                 };
                 InfoList.Add(model);
             }
             NotifyPropertyChanged("InfoList");
             SelectedInfo = InfoList.FirstOrDefault();
         }
     }
 }
Beispiel #9
0
        /// <summary>
        /// 初始化逻辑类
        /// </summary>
        protected override void InitClass()
        {
            base.InitClass();


            ConfigNames.ReadFileAndSendEmailConfigName
                ni
                = new ConfigNames.ReadFileAndSendEmailConfigName();

            #region 构造

            #region EmailTextType ~ 邮件内容类型|text:纯文字;file:文件|如:text

            m_EmailTextType = new StringInfo(ni.EmailTextType);
            InfoList.Add(m_EmailTextType);

            #endregion EmailTextType ~ 邮件内容类型|text:纯文字;file:文件|如:text


            #region DirFullName ~ 完整的Dir名称|如:D:\one(无后缀)|或:~/执行程序所在的目录|如:~/

            m_DirFullName = new StringInfo(ni.DirFullName);
            InfoList.Add(m_DirFullName);

            #endregion DirFullName ~ 完整的Dir名称|如:D:\one(无后缀)|或:~/执行程序所在的目录|如:~/


            #region FileNameExpress ~ 文件名表达式|如:*_bak.log

            m_FileNameExpress = new StringInfo(ni.FileNameExpress);
            InfoList.Add(m_FileNameExpress);

            #endregion FileNameExpress ~ 文件名表达式|如:*_bak.log


            #region ReadFileEncoding ~ 读取文件编码|gb2312/utf8|如:gb2312

            m_ReadFileEncoding = new StringInfo(ni.ReadFileEncoding);
            InfoList.Add(m_ReadFileEncoding);

            #endregion ReadFileEncoding ~ 读取文件编码|gb2312/utf8|如:gb2312


            #region EmailTextFileMaxLength ~ 读取的文件允许最大值|如果是0,则不限,否则超过最大值就不需要读|B为单位|如:0

            m_EmailTextFileMaxLength = new LongInfo(ni.EmailTextFileMaxLength);
            InfoList.Add(m_EmailTextFileMaxLength);

            #endregion EmailTextFileMaxLength ~ 读取的文件允许最大值|如果是0,则不限,否则超过最大值就不需要读|B为单位|如:0

            #region FileNameToLower ~ 文件是否小写比较|如:true

            m_FileNameToLower = new BoolInfo(ni.FileNameToLower);
            InfoList.Add(m_FileNameToLower);

            #endregion FileNameToLower ~ 文件是否小写比较|如:true



            #endregion 构造
        }