コード例 #1
0
ファイル: Diagnostics.cs プロジェクト: uon-crissp/IQTools
        public void Load()
        {
            if (m_filename == string.Empty)
            {
                throw new ArgumentNullException("Filename cannot be empty");
            }
            CheckSums dgs = ObjectXMLSerializer <CheckSums> .Load(m_filename);

            //Diagnostics dgs = Diagnostics.Load(m_filename);
            this.m_checksumfiles = dgs.Files;
            OnFileLoaded(new CheckSumEventArgs(m_filename));
            ////this.m_checksumfiles = dgs.m_checksumfiles;
            dgs = null;
        }
コード例 #2
0
ファイル: Diagnostics.cs プロジェクト: uon-crissp/IQTools
        public static CheckSums Load(Stream FileStream)
        {
            CheckSums ret = null;

            //ret = (Diagnostics) ObjectXMLSerializer<Diagnostics>.Load(FileStream);
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(CheckSums));
                ret = (CheckSums)serializer.Deserialize(FileStream);
                FileStream.Close();
                return(ret);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.InnerException.Message, "Loading Checksums", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
            return(ret);
        }