/// <summary>
        /// Event handler for EnableChanged event in the object-valued Argument.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">EnableChangedEventArgs.</param>
        private void HandleOIDEnabledChanged(object sender, EnabledChangedEventArgs e)
        {
            // If flag is set, do nothing.
            if (IgnoreEditorsEnabledChangeEvent)
            {
                return;
            }

            bool lAllEquals = true;

            // For each editor presentation.
            for (int i = 1; i < mEditors.Count; i++)
            {
                if (mEditors[i - 1].Enabled != mEditors[i].Enabled)
                {
                    lAllEquals = false;
                    break;
                }
            }

            // Raise the event.
            if (lAllEquals)
            {
                OnEnableChanged(new EnabledChangedEventArgs(this, DependencyRulesAgentLogic.Internal, !mEditors[0].Enabled));
            }
        }
        /// <summary>
        /// Raises the EnabledChanged event.
        /// </summary>
        /// <param name="changeEnable">Event argumnts.</param>
        protected virtual void OnEnabledChanged(EnabledChangedEventArgs eventArgs)
        {
            EventHandler <EnabledChangedEventArgs> handler = EnabledChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Occurs when the Enable property of the data-valued Argument changes.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">EnableChangedEventArgs.</param>
 private void HandleEditorEnabledChanged(object sender, EnabledChangedEventArgs e)
 {
     // Do nothing if the flag is set.
     if (IgnoreEditorsEnabledChangeEvent)
     {
         return;
     }
     // Raise the enable changed event.
     OnEnableChanged(new EnabledChangedEventArgs(this, DependencyRulesAgentLogic.Internal, !Enabled));
 }
        /// <summary>
        /// Execute Dependence Rules.
        /// </summary>
        public virtual void ExecuteDependenceRules(ArgumentEventArgs argumentEventArgs)
        {
            if (!mEnabledChangeArgument)
            {
                return;
            }

            UpdateContext();

            Context.SelectedInputField = argumentEventArgs.Name;

            // Execute Dependency Rules
            try
            {
                // if the change is from value.
                ValueChangedEventArgs lChangeValueEventArgs = argumentEventArgs as ValueChangedEventArgs;
                if (lChangeValueEventArgs != null)
                {
                    PendingChanges = true;
                    Logic.ExecuteDependencyRules(
                        Context,
                        lChangeValueEventArgs.OldValue,
                        DependencyRulesEventLogic.SetValue,
                        argumentEventArgs.Agent);
                }

                // if the change is from enable.
                EnabledChangedEventArgs lChangeEnableEventArgs = argumentEventArgs as EnabledChangedEventArgs;
                if (lChangeEnableEventArgs != null)
                {
                    Logic.ExecuteDependencyRules(
                        Context,
                        lChangeEnableEventArgs.Enabled,
                        DependencyRulesEventLogic.SetActive,
                        argumentEventArgs.Agent);
                }
            }
            catch (Exception logicException)
            {
                ScenarioManager.LaunchErrorScenario(logicException);
            }

            // Delete argument selection
            Context.SelectedInputField = string.Empty;

            // Set context
            ConfigureByContext(Context);
        }
        /// <summary>
        /// Raise the EnableChanged event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected virtual void OnEnableChanged(EnabledChangedEventArgs eventArgs)
        {
            EventHandler<EnabledChangedEventArgs> handler = EnableChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Raise the EnableChanged event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected virtual void OnEnableChanged(EnabledChangedEventArgs eventArgs)
        {
            if (mErrorProvider != null)
            {
                mErrorProvider.Clear();
            }

            EventHandler<EnabledChangedEventArgs> handler = EnableChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Raises the EnabledChanged Event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected virtual void OnEnabledChanged(EnabledChangedEventArgs eventArgs)
        {
            //When the enabled event change, the Error porvider is clean.
            if (mErrorProvider != null)
            {
                mErrorProvider.Clear();
            }

            EventHandler<EnabledChangedEventArgs> handler = EnableChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
 /// <summary>
 /// Handles the Enabled Changed event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandlePasswordPresenationEnabledChanged(object sender, EnabledChangedEventArgs e)
 {
     OnEnableChanged(e);
 }
 /// <summary>
 /// Handles the Inut field ChangeEnabled event.
 /// </summary>
 /// <param name="sender">Argument reference.</param>
 /// <param name="changeValue">Event parameters.</param>
 private void HandleInputFieldChangeEnabled(object sender, EnabledChangedEventArgs changeEnable)
 {
     ProcessInputFieldChangeEnabled(changeEnable);
 }
 /// <summary>
 /// Abstract method tha must be implemented in derived class to capture change Enable values.
 /// </summary>
 /// <param name="changeEnable">Event parameters.</param>
 protected virtual void ProcessInputFieldChangeEnabled(EnabledChangedEventArgs changeEnable)
 {
     ExecuteDependenceRules(changeEnable);
 }
        /// <summary>
        /// Method suscribed to ArgumentValueChangedEventHandler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HandleArgumentEnabledChanged(object sender, EnabledChangedEventArgs e)
        {
            EnabledChangedEventArgs lChangeValue = new EnabledChangedEventArgs(sender as ArgumentController, e.Agent);

            OnEnabledChanged(lChangeValue);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Occurs when the Enable property of the data-valued Argument changes.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">EnableChangedEventArgs.</param>
 private void HandleEditorEnabledChanged(object sender, EnabledChangedEventArgs e)
 {
     // Do nothing if the flag is set.
     if (IgnoreEditorsEnabledChangeEvent)
     {
         return;
     }
     // Raise the enable changed event.
     OnEnableChanged(new EnabledChangedEventArgs(this, DependencyRulesAgentLogic.Internal, !Enabled));
 }
 /// <summary>
 /// Abstract method tha must be implemented in derived class to capture change Enable values.
 /// </summary>
 /// <param name="changeEnable">Event parameters.</param>
 protected virtual void ProcessInputFieldChangeEnabled(EnabledChangedEventArgs changeEnable)
 {
     ExecuteDependenceRules(changeEnable);
 }
 /// <summary>
 /// Handles the Inut field ChangeEnabled event.
 /// </summary>
 /// <param name="sender">Argument reference.</param>
 /// <param name="changeValue">Event parameters.</param>
 private void HandleInputFieldChangeEnabled(object sender, EnabledChangedEventArgs changeEnable)
 {
     ProcessInputFieldChangeEnabled(changeEnable);
 }