Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            VersionInfomation versionInfomation = new VersionInfomation();
            List <string>     strList           = new List <string>();

            foreach (string str in this.AppID)
            {
                strList.Add(string.Copy(str));
            }
            versionInfomation.AppID = strList.ToArray();
            strList.Clear();

            return(versionInfomation);
        }
Exemplo n.º 2
0
 /// <summary>
 /// read the binary file from the file path. it will return null if something goes wrong.
 /// </summary>
 /// <param name="filePath"></param>
 /// <returns></returns>
 public static VersionInfomation ReadFromBin(string filePath)
 {
     if (File.Exists(filePath))
     {
         try
         {
             Stream            stream            = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.None);
             IFormatter        formatter         = new BinaryFormatter();
             VersionInfomation versionInfomation = (VersionInfomation)formatter.Deserialize(stream);
             stream.Close();
             return(versionInfomation);
         }
         catch (Exception)
         {
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }