Exemplo n.º 1
0
        public void UpdateInstances(List <WorkflowApplicationInfo> instanceInfos)
        {
            this.Dispatcher.BeginInvoke(
                new Action(() =>
            {
                WorkflowApplicationInfo originalApplicationInfo = CurrentWorkflowApplicationInfo;
                BookmarkInfo originalBookmarkInfo = this.bookmarksComboBox.SelectedItem as BookmarkInfo;

                this.instanceInfos = instanceInfos;
                this.DataContext   = this.instanceInfos;

                if (originalApplicationInfo != null)
                {
                    originalApplicationInfo = this.instanceInfos.Find(applicationInfo => applicationInfo.Id == originalApplicationInfo.Id);
                    if (originalApplicationInfo != null && this.defaultView != null)
                    {
                        this.defaultView.MoveCurrentTo(originalApplicationInfo);
                    }
                    if (originalBookmarkInfo != null)
                    {
                        BookmarkInfo newBookmarkInfo = this.bookmarksComboBox.Items.Cast <BookmarkInfo>().FirstOrDefault(
                            (bookmarkInfo) => bookmarkInfo.BookmarkName == originalBookmarkInfo.BookmarkName);
                        if (newBookmarkInfo != null)
                        {
                            this.bookmarksComboBox.SelectedItem = newBookmarkInfo;
                        }
                    }
                }
            }), DispatcherPriority.DataBind);
        }
Exemplo n.º 2
0
        void OnCurrentChanged(object sender, EventArgs e)
        {
            WorkflowApplicationInfo currentApplicationInfo = CurrentWorkflowApplicationInfo;

            if (currentApplicationInfo != null)
            {
                this.instanceOutputTextBox.Text = currentApplicationInfo.InstanceWriter.ToString();
            }
            SetUiState();
        }
Exemplo n.º 3
0
        void OnResumeBookmarkButtonClicked(object sender, RoutedEventArgs e)
        {
            WorkflowApplicationInfo applicationInfo = this.CurrentWorkflowApplicationInfo;
            BookmarkInfo            bookmarkInfo    = this.bookmarksComboBox.SelectedItem as BookmarkInfo;

            if (applicationInfo != null && bookmarkInfo != null)
            {
                this.manager.ResumeBookmark(applicationInfo.Id, bookmarkInfo.BookmarkName, this.bookmarkValueTextBox.Text);
            }
            this.bookmarkValueTextBox.Text = string.Empty;
        }
Exemplo n.º 4
0
        void SetUiState()
        {
            if (this.IsInitialized)
            {
                WorkflowApplicationInfo currentApplicationInfo = CurrentWorkflowApplicationInfo;
                bool currentApplicationInfoIsNull   = currentApplicationInfo == null;
                bool currentApplicationInfoIsLoaded = !currentApplicationInfoIsNull && currentApplicationInfo.IsLoaded;

                this.abortButton.IsEnabled     = currentApplicationInfoIsLoaded;
                this.cancelButton.IsEnabled    = currentApplicationInfoIsLoaded;
                this.terminateButton.IsEnabled = currentApplicationInfoIsLoaded;
                SetResumeBookmarkButtonState();
            }
        }
Exemplo n.º 5
0
        void OnAbortButtonClicked(object sender, RoutedEventArgs e)
        {
            WorkflowApplicationInfo applicationInfo = this.CurrentWorkflowApplicationInfo;

            this.manager.Abort(applicationInfo.Id, "User requested Abort");
        }
Exemplo n.º 6
0
        void OnTerminateButtonClicked(object sender, RoutedEventArgs e)
        {
            WorkflowApplicationInfo applicationInfo = this.CurrentWorkflowApplicationInfo;

            this.manager.Terminate(applicationInfo.Id, "User initiated Terminate");
        }
Exemplo n.º 7
0
        void OnCancelButtonClicked(object sender, RoutedEventArgs e)
        {
            WorkflowApplicationInfo applicationInfo = this.CurrentWorkflowApplicationInfo;

            this.manager.Cancel(applicationInfo.Id);
        }