Example #1
0
        public virtual void CustomizeArtifactState(ArtifactStateInfo info)
        {
            var args = new ArtifactStateInfoCustomizingEventArgs(info, false);

            OnArtifactStateCustomizing(args);
            if (!args.Cancel)
            {
                foreach (ISupportArtifactState supportArtifactState in providers.Keys.Where(supportArtifactState =>
                                                                                            providers[supportArtifactState].IsAssignableFrom(info.Rule.GetType())))
                {
                    if (info.State == State.Default || info.State == State.Hidden)
                    {
                        if (supportArtifactState is ISupportArtifactStateVisibilityCustomization)
                        {
                            ((ISupportArtifactStateVisibilityCustomization)supportArtifactState).CustomizeVisibility(info);
                        }
                    }
                    else if (info.State == State.Disabled)
                    {
                        if (supportArtifactState is ISupportArtifactStateAccessibilityCustomization)
                        {
                            ((ISupportArtifactStateAccessibilityCustomization)supportArtifactState).CustomizeAccessibility(info);
                        }
                    }
                }
            }
            OnArtifactStateStateCustomized(new ArtifactStateInfoCustomizedEventArgs(info));
        }
Example #2
0
 protected virtual void OnArtifactStateCustomizing(ArtifactStateInfoCustomizingEventArgs args)
 {
     if (ArtifactStateCustomizing != null)
     {
         ArtifactStateCustomizing(this, args);
     }
 }
        void ControllerOnArtifactStateCustomizing(object sender, ArtifactStateInfoCustomizingEventArgs artifactStateInfoCustomizingEventArgs) {
            ArtifactStateInfo artifactStateInfo = artifactStateInfoCustomizingEventArgs.ArtifactStateInfo;
            bool executedAndDisable = artifactStateInfo.State == (State)ActionState.ActionState.ExecutedAndDisable;
            bool b = artifactStateInfo.State == (State)ActionState.ActionState.Executed || executedAndDisable;

            if (b && actionsToExecute.Count==0)            {
//                _executed = true;
                var rule = (((ActionStateRule)artifactStateInfo.Rule));
                foreach (SimpleAction actionBase in GetActions(rule)) {
                    actionsToExecute.Add(actionBase,(ActionState.ActionState) artifactStateInfo.State);
//                    var action = actionBase;
//                    ViewControlsCreated+=(o, args) => ExecuteAction(action, executedAndDisable);
//                    var viewController = ((ViewController) actionBase.Controller);
//                    viewController.ViewControlsCreated +=(sender1, eventArgs) => ExecuteAction(action,executedAndDisable);
                }
            }
        }
Example #4
0
        void ControllerOnArtifactStateCustomizing(object sender, ArtifactStateInfoCustomizingEventArgs artifactStateInfoCustomizingEventArgs)
        {
            ArtifactStateInfo artifactStateInfo = artifactStateInfoCustomizingEventArgs.ArtifactStateInfo;
            bool executedAndDisable             = artifactStateInfo.State == (State)ActionState.ActionState.ExecutedAndDisable;
            bool b = artifactStateInfo.State == (State)ActionState.ActionState.Executed || executedAndDisable;

            if (b && actionsToExecute.Count == 0)
            {
//                _executed = true;
                var rule = (((ActionStateRule)artifactStateInfo.Rule));
                foreach (SimpleAction actionBase in GetActions(rule))
                {
                    actionsToExecute.Add(actionBase, (ActionState.ActionState)artifactStateInfo.State);
//                    var action = actionBase;
//                    ViewControlsCreated+=(o, args) => ExecuteAction(action, executedAndDisable);
//                    var viewController = ((ViewController) actionBase.Controller);
//                    viewController.ViewControlsCreated +=(sender1, eventArgs) => ExecuteAction(action,executedAndDisable);
                }
            }
        }