Beispiel #1
0
        /// <summary>
        /// Initializes the content components.
        /// </summary>
        private void InitializeContent()
        {
            DefaultContent InitialContent = new DefaultContent(Header.Week, wrapper);

            InitialContent.Finish += HandleMenuSelect;

            AddContent(InitialContent);

            AddContent(new CancelRequestController());



            WorkflowInitializer.SetupSchedulingContent(wrapper, AddContent, WorkflowController);



            ContentController.ContentChanged += (object sender, ReferenceArgs <IInterfaceContent> args) =>
            {
                if (args.Value is IComponent c)
                {
                    Content.SetSelected(c);
                }

                OnHomeScreen.Value = args.Value.Name == "Default";
            };

            ContentController.Default = InitialContent.Name;

            ContentController.Activate(ContentController.Default);
        }
Beispiel #2
0
        /// <summary>
        /// Starts a stage.
        /// </summary>
        /// <param name="workflow">The workflow to start from - defaults to current.</param>
        /// <param name="stage">The stage to start - defaults to current.</param>
        /// <param name="set">If the workflow and state should be updated.</param>
        /// <param name="attachevent">If an OnFinish handler should be attached to the stage.</param>
        private void StartStage(string workflow = null, int stage = -1, bool set = false, bool attachevent = false)
        {
            if (workflow == null)
            {
                workflow = current.name;
            }

            if (stage == -1)
            {
                stage = current.stage;
            }

            string[] args = ResolveArguments(stage);
            content_controller.Activate(workflows[workflow].stages[stage], args);

            DebugLog.LogController("Displaying stage " + workflows[workflow].stages[stage]);

            if (set)
            {
                current = new WorkflowInstance()
                {
                    name  = workflow,
                    stage = stage
                };
            }

            if (attachevent)
            {
                content_controller.Current.Finish += OnFinish;
            }
        }