Пример #1
0
        private void EditButtonHandler(object parameter)
        {
            if (SelectedDocumentVersion != null)
            {
                AddEditDocumentVersionDialog dialog = new AddEditDocumentVersionDialog(mDocument, SelectedDocumentVersion);
                dialog.OKButtonClicked +=
                    (s1, e1) =>
                    {
                        DocumentVersion version = (from x in DocumentVersions where x.Id == dialog.SavedDocumentVersion.Id select x).FirstOrDefault();
                        if (version != null)
                        {

                            CommonUtils.CloneObject(SelectedDocumentVersion, dialog.SavedDocumentVersion, dialog.SavedDocumentVersion.Id.ToString());

                            SelectedDocumentVersion.RaisePropertyChanged("Icon");
                            RaisePropertyChanged("DocumentVersions");

                            //UpdateCachedDocuments();

                            //View.DocumentPanel.RevisionHistory.RevisionHistoryGridView.Items.Insert(0, dialog.RevisionHistory);
                            View.DocumentPanel.RevisionHistory.LoadRevisionHistory(CommonUtils.TabId.Documents, mDocument.Id);
                        }
                    };

                dialog.Show();
            }
        }
Пример #2
0
        private void AddButtonHandler(object parameter)
        {
            AddEditDocumentVersionDialog dialog = new AddEditDocumentVersionDialog(mDocument);
            dialog.OKButtonClicked +=
                (s1, e1) =>
                {
                    ObservableCollection<DocumentVersion> list = DocumentVersions;
                    list.Add(s1);
                    DocumentVersions = list;
                    //UpdateCachedDocuments();
                    RaisePropertyChanged("DocumentVersions");
                    OnCollectionChanged();
                    View.DocumentPanel.RevisionHistory.LoadRevisionHistory(CommonUtils.TabId.Documents, mDocument.Id);
                };

            dialog.Show();
        }