/// <summary>
        /// Initializes a new instance of the <see cref="FileDownloadHandler"/> class.
        /// Use this constructor if you want to Run, Open or Cancel the download.
        /// </summary>
        /// <param name="option">The option to choose on the File Download dialog.</param>
        public FileDownloadHandler(FileDownloadOptionEnum option)
        {
            if (option == FileDownloadOptionEnum.Save)
            {
                throw new ArgumentException("When using FileDownloadOptionEnum.Save call the constructor which accepts a filename as an argument");
            }

            _optionEnum = option;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FileDownloadHandler"/> class.
        /// Use this constructor if you want to Run, Open or Cancel the download.
        /// </summary>
        /// <param name="option">The option to choose on the File Download dialog.</param>
        public FileDownloadHandler(FileDownloadOptionEnum option)
        {
            if (option == FileDownloadOptionEnum.Save)
            {
                throw new ArgumentException("When using FileDownloadOptionEnum.Save call the constructor which accepts a filename as an argument");
            }

            _optionEnum = option;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FileDownloadHandler"/> class.
        /// Use this contructor if you want to download and save a file.
        /// </summary>
        /// <param name="filename">The filename.</param>
        public FileDownloadHandler(string filename)
        {
            if (UtilityClass.IsNullOrEmpty(filename))
            {
                throw new ArgumentNullException("filename", "Not a valid value");
            }

            _optionEnum = FileDownloadOptionEnum.Save;
            saveAsFilename = filename;
        }