Example #1
0
        /// <summary>
        /// Overriden to prevent user from opening the selction window if no pre-defined values are selected
        /// </summary>
        /// <returns></returns>
        protected override OpResultEnum OpenSelectionWindowImpl()
        {
            if(!HasPreselectedValues)
            {
                XlateMessageBox.Information(Strings.IQEnumVarActivity_PreselectedRequired);
                return OpResultEnum.Cancelled;
            }

            return base.OpenSelectionWindowImpl();
        }
Example #2
0
        /// <summary>
        /// Opens the IQEnumEditor
        /// </summary>
        /// <param name="currentValue"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        protected override IQOpResult<IQEnum> OpenEditor(IQEnum currentValue, IQVarElementTarget target)
        {
            if (target == IQVarElementTarget.Selected)
            {
                XlateMessageBox.Information(Strings.IQEnumVarActivity_PreselectedRequired);
                return new IQOpResult<IQEnum> {Result = OpResultEnum.Cancelled};
            }

            if (currentValue == null)
                currentValue = new IQEnum {Key = GetNextKey(), Value = String.Empty};

            var editor = new IQEnumEditor {Value = currentValue};
            return editor.ShowDialog() == DialogResult.OK
                       ? new IQOpResult<IQEnum> {Result = OpResultEnum.Completed, Value = editor.Value}
                       : new IQOpResult<IQEnum> {Result = OpResultEnum.Cancelled};
        }
        /// <summary>
        /// Activity heavy lifting.
        /// </summary>
        /// <param name="context"></param>
        protected override void DoWork(CodeActivityContext context)
        {
            //Get Argument Values
            string message = Message.Get(context) ?? String.Empty;
            string caption = Caption.Get(context) ?? String.Empty;

            //Heavy Lifting
            if (String.IsNullOrWhiteSpace(caption))
            {
                XlateMessageBox.Information(message);
            }
            else
            {
                XlateMessageBox.Information(message, caption);
            }
        }
Example #4
0
        private void ShowError()
        {
            string message = string.Empty;

            if (MinValue.HasValue && MaxValue.HasValue)
            {
                message = string.Format(Strings.RangeErrorBetween, MinValue, MaxValue);
            }
            else if (MinValue.HasValue)
            {
                message = string.Format(Strings.RangeErrorBelowMin, MinValue);
            }
            else if (MaxValue.HasValue)
            {
                message = string.Format(Strings.RangeErrorAboveMax, MaxValue);
            }

            if (!string.IsNullOrWhiteSpace(message))
            {
                XlateMessageBox.Information(message);
            }
        }