Example #1
0
        /// <summary> Gets progress dialog configuration. </summary>
        /// <exception cref="ArgumentNullException"> Thrown when one or more required arguments are null. </exception>
        /// <param name="config"> The configuration. </param>
        /// <returns> The progress dialog configuration. </returns>
        private AcrDialogs.ProgressDialogConfig GetProgressDialogConfig(UserDialogProgressConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            var result = new AcrDialogs.ProgressDialogConfig();

            if (config.CancelText != null)
            {
                result.CancelText = config.CancelText;
            }
            if (config.Title != null)
            {
                result.Title = config.Title;
            }
            if (config.AutoShow != null)
            {
                result.AutoShow = config.AutoShow.Value;
            }
            if (config.IsDeterministic != null)
            {
                result.IsDeterministic = config.IsDeterministic.Value;
            }
            if (config.MaskType != null)
            {
                result.MaskType = ConvertToAcrMaskType(config.MaskType.Value);
            }
            if (config.OnCancel != null)
            {
                result.OnCancel = config.OnCancel;
            }

            return(result);
        }
Example #2
0
 /// <summary> Progress the given configuration. </summary>
 /// <param name="config"> The configuration. </param>
 /// <returns> An IUserProgressDialog. </returns>
 public IUserProgressDialog Progress(UserDialogProgressConfig config)
 {
     return(new ProgressDialog(AcrDialogs.UserDialogs.Instance.Progress(GetProgressDialogConfig(config))));
 }