예제 #1
0
        /// <summary>
        /// StackHashCabFile wrapper class
        /// </summary>
        /// <param name="stackHashCabFile">The StackHashCabFile</param>
        public DisplayCabFile(StackHashCabFile stackHashCabFile)
        {
            if (stackHashCabFile == null)
            {
                throw new ArgumentNullException("stackHashCabFile");
            }

            _stackHashCabFile = stackHashCabFile;
        }
예제 #2
0
        /// <summary>
        /// Updates the DisplayCabFile from a StackHashCabFile
        /// </summary>
        /// <param name="stackHashCabFile">StackHashCabFile</param>
        public void UpdateCabFile(StackHashCabFile stackHashCabFile)
        {
            if (stackHashCabFile == null)
            {
                throw new ArgumentNullException("stackHashCabFile");
            }
            if (stackHashCabFile.FileName != _stackHashCabFile.FileName)
            {
                throw new InvalidOperationException("Cannot update from a cab file with a different FileName");
            }

            // save the new cab file
            StackHashCabFile oldCabFile = _stackHashCabFile;

            _stackHashCabFile = stackHashCabFile;

            // check for updates
            if (oldCabFile.Length != _stackHashCabFile.Length)
            {
                RaisePropertyChanged("Length");
            }
        }