示例#1
0
        /// <summary>
        /// Load items from the file.
        /// </summary>
        /// <param name="path">Full path to the file to load.</param>
        /// <param name="fileType">Type of the file to load.</param>
        /// <returns></returns>
        public bool LoadFile(string path, SumFileType fileType)
        {
            bool    success    = false;
            SumFile newSumFile = new SumFile();

            if (newSumFile != null)
            {
                SetSumTypeFromFileType(fileType);
                newSumFile.SetFileList(_checksumItemList);

                int items = 0;
                try
                {
                    items = newSumFile.ReadFile(path, _currentSumType);
                }
                catch (Exception)
                {
                }

                if (items > 0)
                {
                    success = true;
                    // File just loaded, reset change tracking.
                    _checksumItemList.ResetChanges();
                }
            }
            return(success);
        }
示例#2
0
        /// <summary>
        /// Save items to the file.
        /// </summary>
        /// <returns></returns>
        public bool SaveToFile()
        {
            bool success = true;

            try
            {
                SumFile newSumFile = new SumFile();
                newSumFile.SetFileList(_checksumItemList);
                newSumFile.WriteFile(_filename, _currentSumType);
            }
            catch
            {
                success = false;
            }

            return(success);
        }
示例#3
0
        /// <summary>
        /// Save items to the file.
        /// </summary>
        /// <returns></returns>
        public bool SaveToFile()
        {
            bool success = true;

            try
            {
                SumFile newSumFile = new SumFile();
                newSumFile.SetFileList(_checksumItemList);
                newSumFile.WriteFile(Filename, SumType);
            }
            catch
            {
                success = false;
            }

            return success;
        }
示例#4
0
        /// <summary>
        /// Load items from the file.
        /// </summary>
        /// <param name="path">Full path to the file to load.</param>
        /// <param name="fileType">Type of the file to load.</param>
        /// <returns></returns>
        public bool LoadFile(string path, SumFileType fileType)
        {
            bool success = false;
            SumFile newSumFile = new SumFile();

            if (newSumFile != null)
            {
                SetSumTypeFromFileType(fileType);
                newSumFile.SetFileList(_checksumItemList);

                int items = 0;
                try
                {
                    items = newSumFile.ReadFile(path, SumType);
                }
                catch (Exception)
                {

                }

                if (items > 0)
                {
                    success = true;
                    // File just loaded, reset change tracking.
                    _checksumItemList.ResetChanges();
                }
            }
            return success;
        }