Exemplo n.º 1
0
        public AboutInfomation(string productName, string copyright,
                               string author, string description = "无", string contactInfo = "Email: [email protected], Tel: 15618905473")
        {
            this.productName = productName;
            this.copyright   = copyright;
            this.author      = author;
            this.description = description;
            this.contactInfo = contactInfo;
            this.version     = new VersionMananger(
                (DateTime.Now.Year.ToString()
                 + DateTime.Now.Month.ToString()
                 + DateTime.Now.Day.ToString()), 1, 0, 0, VersionMananger.GreekAlphabet.Beta);

            this.historyInfoCollection = new ObservableCollection <VersionAbstract>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 从指定路径中读取内容,设置本实例的各个字段
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public bool Load(string path)
        {
            string[] strs = File_Operate.LoadFromHiddenTextFile(path, Encoding.Default);

            bool res = false;

            if (strs != null)
            {
                string[] ss = strs[0].Split('$');

                string[] s = ss[0].Split('#');

                if (s.Length >= 6)
                {
                    this.author      = s[0];
                    this.contactInfo = s[1];
                    this.copyright   = s[2];
                    this.description = s[3];
                    this.productName = s[4];
                    res = VersionMananger.TryParse(s[5], '*', out this.version);
                }

                for (int i = 1; i < ss.Length; i++)
                {
                    s = ss[i].Split('*');

                    if (s.Length >= 2)
                    {
                        VersionAbstract a = new VersionAbstract();

                        a.Version     = s[0];
                        a.Description = s[1];

                        this.historyInfoCollection.Add(a);
                    }
                }
            }

            return(res);
        }