Example #1
0
        private void MenuItem_Revision_Print(object sender, RoutedEventArgs e)
        {
            RevisionsRevisionViewModel instance = ((MenuItem)sender).Tag as RevisionsRevisionViewModel;

            try
            {
                List <PrintHeaderViewModel> Headers = new List <PrintHeaderViewModel>();
                int counter = 0;

                Headers.Add(new PrintHeaderViewModel(instance.RevisionName + " / " + instance.RevisionDate, new List <PrintLineViewModel>(instance.Children
                                                                                                                                          .Select(comment => new PrintLineViewModel(new List <string>()
                {
                    (counter = counter + 1).ToString() + ".",
                    comment.Comment
                },
                                                                                                                                                                                    PageInfo.ColumnWidths_Revisions)))));


                //Assign PageInfo
                PageInfo.AssignPageInfo_Revisions("Revision");

                //Add additional empty line
                List <PrintHeaderViewModel> HeadersWithAdditionalEmptyLines = Utilities.ForEachRecordAddEmptyLine(Headers, PageInfo.ColumnWidths_Revisions);

                //Send Complete data to print
                Utilities.PrintA4Vertical(HeadersWithAdditionalEmptyLines, "Revision_" + instance.RevisionName);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace); }
        }
Example #2
0
        private void MenuItem_Revision_DisplayHint(object sender, RoutedEventArgs e)
        {
            RevisionsRevisionViewModel instance = ((MenuItem)sender).Tag as RevisionsRevisionViewModel;
            Revision target = instance.Revision;

            Window_RevisionsHint window = new Window_RevisionsHint(target);

            window.ShowDialog();
        }
Example #3
0
        private void MenuItem_Revision_HideAllButThis(object sender, RoutedEventArgs e)
        {
            try
            {
                RevisionsRevisionViewModel instance = ((MenuItem)sender).Tag as RevisionsRevisionViewModel;
                Revision target = instance.Revision;

                EventHandler_Revision_HideAllButThis.thisCmd.AssignDocumentAndElement(target);
                Cmd_RegisterEvents.thisCmd.ExEvent_Revision_HideAllButThis.Raise();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "/n" + ex.StackTrace); }
        }
Example #4
0
        private void MenuItem_Revision_SwitchVisibility(object sender, RoutedEventArgs e)
        {
            try
            {
                RevisionsRevisionViewModel instance = ((MenuItem)sender).Tag as RevisionsRevisionViewModel;
                Revision target = instance.Revision;
                //instance.Visibility = (instance.Visibility == true) ? false : true;

                EventHandler_Revision_Visibility.thisCmd.AssignDocumentAndElement(target);
                Cmd_RegisterEvents.thisCmd.ExEvent_Revision_Visibility.Raise();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "/n" + ex.StackTrace); }
        }
Example #5
0
        private void TextBox_Rev_IssuedBy_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                try
                {
                    RevisionsRevisionViewModel instance = (RevisionsRevisionViewModel)((TextBox)sender).Tag;
                    string newTextValue = ((TextBox)sender).Text;

                    EventHandler_Revision_ChangeRevDescription.thisCmd.GetData(instance.Revision, newTextValue, "IssuedBy");
                    Cmd_RegisterEvents.thisCmd.ExEvent_Revision_ChangeRevDescription.Raise();
                }
                catch (Exception ex) { MessageBox.Show(ex.Message + "\n" + ex.StackTrace); }
            }
        }
Example #6
0
        private void MenuItem_Revision_Issued(object sender, RoutedEventArgs e)
        {
            try
            {
                RevisionsRevisionViewModel instance = ((MenuItem)sender).Tag as RevisionsRevisionViewModel;
                Revision target = instance.Revision;
                //instance.Issued = (instance.Issued == true) ? false : true;

                foreach (RevisionsCommentViewModel comment in instance.Children)
                {
                    comment.Issued = instance.Issued;
                    foreach (RevisionsViewViewModel view in comment.Children)
                    {
                        view.Issued = instance.Issued;
                    }
                }

                EventHandler_Revision_Issued.thisCmd.AssignDocumentAndElement(target);
                Cmd_RegisterEvents.thisCmd.ExEvent_Revision_Issued.Raise();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "/n" + ex.StackTrace); }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="revClouds"></param>
        /// <param name="issued"></param>
        /// <param name="parent"></param>
        public RevisionsCommentViewModel(List <RevisionCloud> revClouds, bool issued, RevisionsRevisionViewModel parent)
        {
            this.ThisInstance = this;
            this.Issued       = issued;
            this.Parent       = parent;

            try
            {
                this.Comment = revClouds.First().get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).AsString();
            }
            catch { }

            this.Children = new ObservableCollection <RevisionsViewViewModel>(revClouds.Select(cloud => new RevisionsViewViewModel(cloud, this, issued)));
        }