Compare commits

...

138 Commits

Author SHA1 Message Date
mschill 06c3136566 Merge branch 'Development' into C2026-043-Tech-Debt_v1 2026-07-21 10:38:53 -04:00
jjenko abaf55e9b1 Merge pull request 'C2026-046 - Decrease check if need to update ROs.' (#793) from C2026-046 into Development
good for testing
2026-07-21 10:32:30 -04:00
mschill 3a2dd0b0aa C2026-046 - Decrease check if need to update ROs. 2026-07-21 10:24:46 -04:00
mschill 9486b37300 C2026-043-Tech-Debt_v1 - Stash 1 2026-07-21 06:49:28 -04:00
jjenko 0fed1acfd8 Merge pull request 'F2026-017 Blank line was sometimes missing after the Note and Caution text. This was a 64-bit build difference that affected the text width calculations.' (#792) from F2026-017_SummerCautionNoteAdj into Development
Format only change - good for testing phase
2026-07-17 10:11:25 -04:00
jjenko d7c2300021 F2026-017 Blank line was sometimes missing after the Note and Caution text. This was a 64-bit build difference that affected the text width calculations. 2026-07-17 10:11:43 -04:00
jjenko fca333299d Merge pull request 'C2026 044' (#791) from C2026-044 into Development
good for testing phase
2026-07-16 08:53:54 -04:00
mschill a13b03a136 C2026-044 – ve_GetParentItem Performance Improvement
Added Included columns to Index
2026-07-16 08:48:11 -04:00
mschill 48054f5bf1 C2026-044 – ve_GetParentItem Performance Improvement 2026-07-16 08:26:52 -04:00
mschill 51f2897a33 C2026-044 – ve_GetParentItem Performance Improvement 2026-07-16 08:26:07 -04:00
jjenko 7c3cfca86c Merge pull request 'B2026-055 – Transition Search Improvements' (#790) from B2026-055 into Development
good for testing
2026-07-15 13:54:03 -04:00
mschill 352af15984 B2026-055 – Transition Search Improvements 2026-07-15 12:43:38 -04:00
jjenko 2c42933d58 Merge pull request 'F2026-016 Robinson- created a new sub-format for a Foldout section that uses a smaller font size.' (#789) from F2026-016_Robinson_Foldout_Format into Development
format only change. good for testing
2026-07-10 09:57:15 -04:00
jjenko 2e68362836 F2026-016 Robinson- created a new sub-format for a Foldout section that uses a smaller font size. 2026-07-10 09:56:58 -04:00
jjenko c6736db7ea Merge pull request 'B2026-065 Adjusted the Callaway Two Column format for the position of RNO tables.' (#788) from B2026-065_RNO_TablePositionAdjustment into Development
format only change.  Good for testing
2026-07-09 10:41:42 -04:00
jjenko c005f03af8 B2026-065 Adjusted the Callaway Two Column format for the position of RNO tables. 2026-07-09 10:41:46 -04:00
jjenko 459aabcc86 Merge pull request 'B2026-064 – Updating ROs from Display ROs should not error' (#787) from B2026-064 into Development
good for testing
2026-07-07 11:01:30 -04:00
mschill ad33097d5e B2026-064 – Updating ROs from Display ROs should not error 2026-07-07 10:59:51 -04:00
jjenko 8d7735735e Merge pull request 'F2026_015 Moved the change bar position to the right one space to accommodate the wider Caution and Note boxes' (#786) from F2026-015_SouthTexas_ChgBars into Development
format only change.  Ready for testing
2026-07-01 09:15:24 -04:00
jjenko 25bbc46925 F2026_015 Moved the change bar position to the right one space to accommodate the wider Caution and Note boxes 2026-07-01 09:17:23 -04:00
jjenko 5a26b0ee35 Merge pull request 'B2026-054 - When performing a Transition search, the Formats dropdown list is repeating several times.' (#785) from B2026-054 into Development
good for testing phase
2026-07-01 08:19:38 -04:00
mschill 09a397bed2 B2026-054 - When performing a Transition search, the Formats dropdown list is repeating several times. 2026-07-01 07:21:25 -04:00
jjenko a33039bcae Merge pull request 'F2026-014 South Texas EOP format – adjusted the Caution and Note box width. Also remove the extra space between bullets and multiple Caution/Note text' (#784) from F2026-014_SouthTexas_Caution_Box_Width into Development
format only changes - ready for testing
2026-06-30 14:34:22 -04:00
jjenko 0ebd125266 F2026-014 South Texas EOP format – adjusted the Caution and Note box width. Also remove the extra space between bullets and multiple Caution/Note text 2026-06-30 14:35:28 -04:00
jjenko fd16a6b6c3 Merge pull request 'B2026-063 - Issue Deleting Steps with Grids' (#783) from B2026-063 into Development
good for testing
2026-06-30 13:50:22 -04:00
mschill cf19f764c7 Copy / Paste Error when updating Revision Comment 2026-06-30 13:49:37 -04:00
jjenko 88850d6c25 Merge pull request 'B2026-063 - Issue Deleting Steps with Grids' (#782) from B2026-063 into Development
good for testing phase
2026-06-30 09:28:28 -04:00
mschill b173c61575 B2026-063 - Issue Deleting Steps with Grids 2026-06-30 09:11:43 -04:00
jjenko 3b866f0952 Merge pull request 'B2026-057 - Issue when ROs are out of date and swapping between sets – sometimes asked if want to update ROs twice if said no the first time.' (#781) from B2026-057 into Development
good for testing phase
2026-06-29 10:00:42 -04:00
mschill 94db524a11 B2026-057 - Issue when ROs are out of date and swapping between sets – sometimes asked if want to update ROs twice if said no the first time. 2026-06-29 09:51:48 -04:00
jjenko f27616ce1f Merge pull request 'B2026-052 - Issue when parens inside a Hardspaced Multi-RO Return Values.' (#780) from B2026-052 into Development
good for testing phase
2026-06-29 08:47:11 -04:00
mschill 7f75af7119 B2026-052 - Issue when parens inside a Hardspaced Multi-RO Return Values.
PROMS crashes when doing an update ROFst.
2026-06-25 15:46:25 -04:00
mschill 38e42723af Merge pull request 'B2026-060, B2026-061, Fixed issue where change bars were printing when they should not have been.' (#778) from B2026-60_B2026-61 into Development
Looks Good. Ready for QA!
2026-06-18 14:18:24 -04:00
jjenko f4ec60c9e0 B2026-060, B2026-061, Fixed issue where change bars were printing when they should not have been. 2026-06-18 14:06:30 -04:00
jjenko 01394b1978 Merge pull request 'B2026 058' (#777) from B2026-058 into Development
good for testing
2026-06-12 15:15:39 -04:00
mschill 9b7db08fcf update unicode 2026-06-12 15:02:01 -04:00
mschill 6d7cdef223 B2026-058 – If approving multiple procedures at the same time with a multiunit set and one of the procedures is open, PROMS sometimes loses that it is set for an individual unit. 2026-06-12 14:57:42 -04:00
jjenko d9c35fe02a Merge pull request 'C2026 021 b2026 048' (#775) from C2026-021_B2026-048 into Development
good for testing
2026-05-29 09:47:07 -04:00
mschill 250b3fa406 Remove commented out code 2026-05-29 06:33:37 -04:00
mschill a5a3f16177 C2026-021_B2026-048 Expand Functionality of Viewing Mode 2026-05-29 06:06:58 -04:00
jjenko ffa7e21c18 Merge pull request 'B2026-050 Problem when Approval with Duplicate Rev Numbers' (#773) from B2026-050 into Development
good for testing phase
2026-05-26 08:38:20 -04:00
mschill 4608c05df0 B2026-050 Problem when Approval with Duplicate Rev Numbers 2026-05-26 07:01:43 -04:00
jjenko 56ff5a0213 Merge pull request 'B2026-051 Fix Error loading Display Ros when cannot find RO lookup' (#772) from B2026-051 into Development
good for testing phase
2026-05-22 11:34:31 -04:00
mschill 014fde301c B2026-051 Fix Error loading Display Ros when cannot find RO lookup 2026-05-22 11:07:57 -04:00
jjenko 0080a42423 Merge pull request 'C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST' (#756) from C2026-008 into Development
Reviewed-on: #756
Reviewed-by: John Jenko <jjenko@volian.com>

This was pre-tested prior to  this merge.
2026-05-19 09:24:09 -04:00
mschill 2035a4c855 Merge branch 'Development' into C2026-008 2026-05-19 08:59:34 -04:00
jjenko 4dc6a190fa Merge pull request 'C2026-037 Change History Deleted Items to 24-hour clock' (#771) from C2026-037 into Development
good for testing
2026-05-19 08:56:47 -04:00
mschill e0db322262 C2026-037 Change History Deleted Items to 24-hour clock 2026-05-19 06:56:31 -04:00
mschill 8f1bb45e42 C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST
--Fix for Blank popup box when completes updating ROs through Admin Tool & fix for updating ROs when fails part way through (if network error, etc…)
2026-05-15 07:09:21 -04:00
mschill f39aefd28f Merge branch 'Development' into C2026-008 2026-05-14 10:40:00 -04:00
jjenko 2cfc43dbfd Merge pull request 'B2026-045 Issue with Refreshing Changebars when Approval is done multiple times in a row on Multi-unit. Printing was ok but the UI required leaving PROMS and going back in.' (#769) from B2026-045 into Development
good for testing
2026-05-13 15:38:26 -04:00
mschill f4168b5202 B2026-045 Issue with Refreshing Changebars when Approval is done multiple times in a row on Multi-unit. Printing was ok but the UI required leaving PROMS and going back in. 2026-05-13 15:02:52 -04:00
jjenko 2d93b652e8 Merge pull request 'B2026-046-RO-symbols-and-Annotations' (#768) from B2026-046-RO-symbols-and-Annotations into Development
good for testing
2026-05-13 13:43:12 -04:00
plarsen 70782cd655 B2026-046-RO-symbols-and-Annotations 2026-05-13 13:37:12 -04:00
mschill 768fcc4f05 Fix Bug in Dotnet Bar related to multiple events and closing display tabs 2026-05-12 08:54:26 -04:00
mschill 727491f99b Merge branch 'C2026-008' of https://git.volian.com/Volian/SourceCode into C2026-008 2026-05-11 14:43:49 -04:00
mschill c5f1c3a340 C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST
Update ProgressBar & fix Already Checked out popup multiple times
2026-05-11 14:42:48 -04:00
mschill a78311104a Merge branch 'Development' into C2026-008 2026-05-11 14:41:01 -04:00
plarsen 4b5b06210c B2026-046-RO-symbols-and-Annotations 2026-05-08 23:20:38 -04:00
jjenko 333645b044 Merge pull request 'F2026_013 Fixed typo in Vogtle format title' (#767) from F2026-013_Vogtle_3_4_Format into Development
format only change - good for testing phase
2026-05-07 15:23:01 -04:00
jjenko 23173074aa F2026_013 Fixed typo in Vogtle format title 2026-05-07 15:21:48 -04:00
jjenko be8bb9c4e1 Merge pull request 'B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function' (#765) from B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function into Development
good for testing phase
2026-05-07 15:07:27 -04:00
plarsen d07e132216 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-07 14:55:44 -04:00
plarsen 401fa12851 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-07 13:29:55 -04:00
plarsen 194ca84d38 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-07 11:34:16 -04:00
plarsen 7bbf62d735 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-07 11:27:36 -04:00
plarsen 3924e2fca5 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-06 07:54:39 -04:00
plarsen 2e39102e7c Merge branch 'Development' into B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-05 22:26:21 -04:00
plarsen 2a0849fae5 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-05 22:08:27 -04:00
jjenko 9f4e8f6eef Merge pull request 'C2026-014 Set Changebar date with multi-unit' (#766) from C2026-014 into Development
good for testing
2026-05-05 09:05:23 -04:00
mschill d0fe36f86e C2026-014 Set Changebar date with multi-unit 2026-05-05 08:50:39 -04:00
jjenko 10da22cd77 Merge pull request 'C2026-015 Set overall Changebar date when approving multi-unit' (#764) from C2026-015 into Development
good for testing
2026-05-05 08:44:47 -04:00
mschill 6dacc2d515 Merge branch 'Development' into C2026-015 2026-05-05 06:08:19 -04:00
mschill 7baa9628d6 C2026-015 Set overall Changebar date when approving multi-unit 2026-05-05 06:00:43 -04:00
plarsen ec5229101f B2026-043-Fix-Error-for-Set_At_AAll_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-04 17:00:42 -04:00
plarsen a0e0b1e788 B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function 2026-05-04 16:33:08 -04:00
jjenko f1e04396de Merge pull request 'B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4' (#762) from B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 into Development
good for testing
2026-05-04 09:11:33 -04:00
plarsen d0cae8c2fc B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 2026-05-04 08:48:51 -04:00
plarsen 90c215d4c1 B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 2026-05-01 16:26:04 -04:00
plarsen 1b1dc78548 C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 2026-04-30 16:37:10 -04:00
jjenko a112163f85 Merge pull request 'C2026-015 Set overall Changebar date when approving multi-unit' (#761) from C2026-015 into Development
ready for testing
2026-04-30 14:01:58 -04:00
mschill 2a9f2e188d C2026-015 Set overall Changebar date when approving multi-unit 2026-04-30 13:53:02 -04:00
jjenko 652e0cb06f Merge pull request 'C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3' (#760) from C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3 into Development
ready for testing
2026-04-30 08:41:01 -04:00
plarsen 123b1b08c2 C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3 2026-04-30 08:20:41 -04:00
plarsen b321bc354b C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3 2026-04-28 18:09:15 -04:00
plarsen 03d7397242 Merge remote-tracking branch 'origin/Development' into Development 2026-04-28 14:39:52 -04:00
mschill 45e78ef184 Merge branch 'Development' into C2026-008 2026-04-28 13:43:35 -04:00
jjenko fe7c5893bb Merge pull request 'B2026-040 - Signoff/Checkoffs not printing unless set to Section Default' (#758) from B2026-040 into Development
good for testing
2026-04-28 11:11:45 -04:00
mschill 2b57c552d1 B2026-040 - Signoff/Checkoffs not printing unless set to Section Default 2026-04-28 11:03:04 -04:00
mschill 7f0d39b684 C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST 2026-04-28 09:13:17 -04:00
plarsen 7273a8b13b Development 2026-04-27 15:43:38 -04:00
jjenko a544a5cd4f Merge pull request 'B2026-037 - Remove Fix Symbol Font' (#755) from B2026-037 into Development
good for testing phase
2026-04-16 14:02:42 -04:00
mschill ff9ade75d4 B2026-037 - Remove Fix Symbol Font 2026-04-16 09:32:02 -04:00
mschill cfd5498521 Merge pull request 'C2026-033 Added logic to not display the Empty Procedure message box if we are printing via baseline print testing.' (#754) from C2026-033_Baseline_Printing into Development
Looks Good. Ready for QA.
2026-04-15 11:55:19 -04:00
jjenko 9b7c30e1cd C2026-033 Added logic to not display the Empty Procedure message box if we are printing via baseline print testing. 2026-04-15 11:28:21 -04:00
mschill 670e5d7fa9 Merge pull request 'Baseline Application fixes' (#753) from baseline into Development
Looks good. Ready for QA.
2026-04-13 11:13:50 -04:00
jjenko 8258235611 Baseline Application fixes 2026-04-13 11:06:50 -04:00
jjenko 4d97f29943 Merge pull request 'B2026-035_fix_RO_Preview_for_X_Y_Plots' (#751) from B2026-035_fix_RO_Preview_for_X_Y_Plots into Development
good for testing
2026-03-31 08:53:49 -04:00
plarsen ab8d59eb2d Merge branch 'Development' into B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-31 08:48:01 -04:00
plarsen c324fa69b2 B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-31 08:47:43 -04:00
plarsen 1cdb9b4cc2 Development 2026-03-31 08:43:41 -04:00
plarsen f47fa49b80 B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-30 16:12:37 -04:00
plarsen 6ade96c7ef B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-30 13:41:03 -04:00
plarsen 61d31a3c67 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-03-30 13:05:08 -04:00
mschill 014509ea30 Merge pull request 'B2026-036 Fixed issue where if a RO return value and a dash followed by numbers, the numbers following the dash would be truncated when inserting in step editor text.' (#750) from General_Debugging into Development
Looks Good. Ready for QA.
2026-03-27 15:32:54 -04:00
jjenko 1ce1a45ca6 B2026-036 Fixed issue where if a RO return value and a dash followed by numbers, the numbers following the dash would be truncated when inserting in step editor text. 2026-03-27 15:26:06 -04:00
plarsen b6da13a653 Development 2026-03-26 11:49:54 -04:00
jjenko 604b4d1751 Merge pull request 'C2026-031 - BNPP Cover Page Consolidation' (#748) from BNPP_CoverPage_Consolidation into Development
good for testing phase
2026-03-26 09:28:07 -04:00
mschill 874aaf2857 Merge branch 'Development' into BNPP_CoverPage_Consolidation 2026-03-26 09:15:23 -04:00
mschill 17a28def4e Update Copyright date 2026-03-26 09:17:13 -04:00
jjenko e72a1aa9e7 Merge pull request 'B2026-018_The_Disable_Initial_Line_check_box' (#747) from B2026-018_The_Disable_Initial_Line_check_box into Development
good for testing phase
2026-03-26 09:11:20 -04:00
mschill 7b96ef1b4c BNPP Cover Page Consolidation 2026-03-26 09:02:14 -04:00
plarsen ea048e6d82 B2026-018_The_Disable_Initial_Line_check_box 2026-03-26 07:55:27 -04:00
plarsen 109abfb4ad Merge branch 'Development' into B2026-018_The_Disable_Initial_Line_check_box 2026-03-26 07:53:21 -04:00
plarsen 3f662ab19d B2026-018_The_Disable_Initial_Line_check_box 2026-03-25 22:55:52 -04:00
jjenko b0de38909a Merge pull request 'B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots' (#746) from B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots into Development
good for testing phase
2026-03-25 13:26:02 -04:00
plarsen 267de44103 Merge branch 'Development' into B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:54:12 -04:00
plarsen b7b0e55d94 B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:41:39 -04:00
plarsen c0d12f5721 B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:34:58 -04:00
mschill 27a945485f Merge pull request 'B2026-034 Fixed issue where import of procedure set failed when it was deleting the temporary folders that are created during the process, preventing the importing code to try and fix transitions and foldout information (link).' (#745) from B2026-034 into Development
Looks Good. Ready for QA.
2026-03-25 06:04:23 -04:00
jjenko d76c81a9d8 B2026-034 Fixed issue where import of procedure set failed when it was deleting the temporary folders that are created during the process, preventing the importing code to try and fix transitions and foldout information (link). 2026-03-24 16:27:22 -04:00
jjenko 143a3622dd Merge pull request 'C2026-007_B2026-027' (#744) from C2026-007_B2026-027 into Development
good for continued  testing
2026-03-24 08:56:31 -04:00
mschill 75992293c6 Merge branch 'Development' into C2026-007_B2026-027 2026-03-24 08:45:28 -04:00
mschill 0e004828b3 Merge branch 'C2026-007_B2026-027' of https://git.volian.com/Volian/SourceCode into C2026-007_B2026-027 2026-03-24 08:46:04 -04:00
mschill 714751f404 C2026-007 Admin Tool Generate Word Attachments 2026-03-24 08:45:55 -04:00
jjenko 27576e946e Merge pull request 'C2026-007 - Handle case for Step Progress when all switchboxes are turned off and then Regen Word Attachments is turned back on.' (#743) from C2026-007_B2026-027 into Development
good for testing
2026-03-23 08:13:48 -04:00
mschill e548dddcbd Merge branch 'Development' into C2026-007_B2026-027 2026-03-23 08:04:33 -04:00
mschill 8cbc8c497e C2026-007 - Handle case for Step Progress when all switchboxes are turned off and then Regen Word Attachments is turned back on. 2026-03-23 06:30:41 -04:00
jjenko c328140441 Merge pull request 'B2026-033 Tooltip for Generate Word Attachments' (#742) from B2026-033 into Development
good for testing
2026-03-20 15:37:05 -04:00
mschill a10798c983 B2026-033 Tooltip for Generate Word Attachments 2026-03-20 15:30:51 -04:00
jjenko 06909e260f Merge pull request 'B2026-030 GoTo sometimes requires being pressed twice for ROs' (#741) from B2026-030 into Development
good for testing
2026-03-18 14:47:28 -04:00
mschill 5eca8a5150 B2026-030 GoTo sometimes requires being pressed twice for ROs 2026-03-18 14:44:45 -04:00
jjenko 88a13f9864 Merge pull request 'C2026-028 Update Tooltip for “Set All at Level” in Applicability.' (#740) from C2026-028 into Development
good for testing
2026-03-18 08:21:01 -04:00
mschill e03ae6195a C2026-028 Update Tooltip for “Set All at Level” in Applicability. 2026-03-18 07:53:17 -04:00
jjenko c3cacaf407 Merge pull request 'B2026-022-Adding-RO-Editor-symbols-to-RO-Tables' (#738) from B2026-022-Adding-RO-Editor-symbols-to-RO-Tables into Development
good for testing
2026-03-17 16:09:54 -04:00
jjenko c78cb805fb Merge pull request 'C2026-030 corrected the Alarm format cover page' (#739) from C2026-030_BNPP_CoverAdjustments into Development
format only change. good for tesing
2026-03-17 11:25:24 -04:00
jjenko d17688fc9d C2026-030 corrected the Alarm format cover page 2026-03-17 11:24:24 -04:00
plarsen 7b649c4a62 B2026-018_The_Disable_Initial_Line_check_box 2026-03-10 08:24:28 -04:00
112 changed files with 9570 additions and 14989 deletions
+118 -40
View File
@@ -456,7 +456,7 @@ namespace Baseline
switch (myLast)
{
case LastWas.Pagination:
line = OpenPDF(line);
OpenPDF(line);
break;
case LastWas.Baseline: // TODO: Need to add code here to open matching file
OpenOnePDF(myLine,1);
@@ -479,7 +479,7 @@ namespace Baseline
switch (myLast)
{
case LastWas.Pagination:
line = OpenPDF(line);
OpenPDF(line);
break;
case LastWas.Baseline: // TODO: Need to add code here to open matching file
OpenOnePDF(myLine,2);
@@ -491,34 +491,99 @@ namespace Baseline
break;
}
}
string exePath;
private string OpenPDF(string line)
/// <summary>
/// This will return the full path to the PDF file
/// </summary>
/// <param name="fi"></param>
/// <param name="patern"></param>
/// <returns></returns>
private string GetPFDFileAndPath(FileInfo fi, string patern)
{
int page = int.Parse(line.Substring(0, 6));
string[] fileList = Directory.GetFiles(fi.DirectoryName, patern);
// sort the list of file list
Array.Sort((string[])fileList);
return fileList.First(); // the PDF file that we what should be top of the list then.
}
/// <summary>
/// This will parse out the procedure number for the PROMS ShortPath representation of a procedure section or step part
/// In the PROMS ShortPath, ".S" is used to delimit the procedure number, section then uses "..S" for the step parts
/// This method was written to handle cases where ".S" is used as part of the procedure number
/// </summary>
/// <param name="txt"></param>
/// <returns></returns>
private string ParseOutProcedureNumberFromLine(string txt)
{
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
// 1.SBGEN.SC. ==> short path of attachment section "C"
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
string rtnstr = null;
int lidx = -1;
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
// so look for the last occurence of ".." which will be the end of the section information
lidx = txt.LastIndexOf("..");
if (lidx > 0)
{
lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number
}
else
{
lidx = txt.LastIndexOf(".S"); // this will position us to the end of the procedure number if there was no step information
}
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
line = line.Substring(8, line.IndexOf(".S") - 8).Replace("/", "_").Replace("\\", "_");
rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
return rtnstr;
}
string exePath;
private void OpenPDF(string line)
{
int pageNum = int.Parse(line.Substring(0, 6));
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
string ProcNum = ParseOutProcedureNumberFromLine(line);
string procPatern = string.Format("*{0}*.pdf", string.IsNullOrEmpty(line) ? "noProcNumber" : ProcNum);
FindFile ff = lbDifferent.SelectedItem as FindFile;
FileInfo fi1 = new FileInfo(ff.File1);
FileInfo fi2 = new FileInfo(ff.File2);
string PDFfileName1 = GetPFDFileAndPath(fi1,procPatern);
string PDFfileName2 = GetPFDFileAndPath(fi2,procPatern);
if (string.IsNullOrEmpty(PDFfileName1) || string.IsNullOrEmpty(PDFfileName2)) return;
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
if (exePath == null)
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf");
exePath = TryToGetPath(p);
p.Kill(); // No need to keep it open
try
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
exePath = TryToGetPath(p);
p.Kill(); // No need to keep it open
}
catch (Exception ex)
{
Application.DoEvents();
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
Console.WriteLine(msg);
MessageBox.Show(msg, "Error opening default PDF Viewer");
return;
}
}
// Open the first PDF on a Specific Page
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi1.DirectoryName + "\\" + line + ".pdf ");
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum,PDFfileName1));
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
// Move the PDF Reader window to 0,0
MoveProcess(p1, 0, 0);
// Open the first PDF on a Specific Page
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi2.DirectoryName + "\\" + line + ".pdf ");
// Open the second PDF on a Specific Page
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum, PDFfileName2));
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
// Move the PDF Reader window to 960,0
// TODO: This Offset could be a Setting
MoveProcess(p2, 960, 0);
return line;
return;
}
/// <summary>
/// Try to get the location of the PDF Reader executable
@@ -530,7 +595,7 @@ namespace Baseline
p.WaitForInputIdle();
while (p.MainModule == null)
{
Console.WriteLine("{0} - {1}", p.MainWindowTitle,p.ProcessName);
Console.WriteLine("{0} - {1}", p.MainWindowTitle, p.ProcessName);
p.WaitForInputIdle();
Application.DoEvents();
}
@@ -594,40 +659,52 @@ namespace Baseline
/// <param name="list"></param>
private void OpenOnePDF(Line myLine, int list)
{
if (myLine == null) return; // no PDF to open
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
// if no procedure number, PROMS creates pdf filename "NoProcNumber.pdf"
// create pattern to use to get the PDF from the directory
// add wildcards (*) to file the file if any prefix or suffix was added to the filename
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
int pagenum = myLine.MyPage.Number;
FindFile ff = lbDifferent.SelectedItem as FindFile;
FileInfo fi1 = new FileInfo(ff.File1);
FileInfo fi2 = new FileInfo(ff.File2);
if (exePath == null)
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf");
while (exePath == null)
{
try
{
exePath = p.MainModule.FileName;
}
catch (Exception ex)
{
Application.DoEvents();
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
}
}
p.Kill();
}
string PDFfileName = null;
if (list == 1)
{
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf ");
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
FileInfo fi1 = new FileInfo(ff.File1);
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
}
else
else // list == 2
{
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf ");
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2);
FileInfo fi2 = new FileInfo(ff.File2);
PDFfileName = GetPFDFileAndPath(fi2, procPatern);
}
if (string.IsNullOrEmpty(PDFfileName)) return; // no PDF to open
// if exePath is null, then open the found PDF with the default PDF viewer and
// capture/save the entire name and path of the default PDF viewer
if (exePath == null)
{
try
{
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
exePath = TryToGetPath(tp);
tp.Kill();
}
catch (Exception ex)
{
Application.DoEvents();
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
Console.WriteLine(msg);
MessageBox.Show(msg, "Error opening default PDF Viewer");
return;
}
}
// open the PDF and jump to the page number
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName));
psi1.UseShellExecute = false;
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
}
/// <summary>
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
@@ -709,11 +786,12 @@ namespace Baseline
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
{
//Initialize Results List Box
lbResults1.Items.Clear();
Procedure myProc = lbProcedures.SelectedItem as Procedure;
if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures
//TODO: May need to consider if there are duplicate procedure numers and titles
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
// Build the results ListBox for the left window
lbResults1.Items.Clear();
if (myProc1 != null)
{
foreach (Page myPage in myProc1.MyPages)
+1
View File
@@ -179,6 +179,7 @@
<Content Include="fmtall\CPL_00all.xml" />
<Content Include="fmtall\CPL_01all.xml" />
<Content Include="fmtall\CPL_02all.xml" />
<Content Include="fmtall\CPL_04all.xml" />
<Content Include="fmtall\CPL_03all.xml" />
<Content Include="fmtall\CPSAMGDataall.xml" />
<Content Include="fmtall\CPSAMGDEVall.xml" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -253
View File
@@ -422,150 +422,6 @@ namespace LBWordLibrary
return true;
return false;
}
/// <summary>
/// If document contains symbol characters, returns problem font.
/// </summary>
public string FontHasSymbolCharacters
{
get
{
LBRange myRange = Range();
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
myRange.Start = 0;
int end = myRange.End;
string myText = GetRangeText(myRange);
//return _RegFindSymbol.IsMatch(myText);
MatchCollection problems = _RegFindSymbol.Matches(myText);
int offset = 0;
List<string> alreadyProcessed = new List<string>();
List<string> fontHasSymbols = new List<string>();
foreach (Match problem in problems)
{
if (!alreadyProcessed.Contains(problem.Value))
{
myRange.Start = problem.Index + offset;
myRange.End = problem.Index + problem.Length + offset;
int newOffset = FindRangeOffset(myRange, problem, offset, end);
string fontName = myRange.Font.Name;
if (IsSymbolFont(fontName))
{
if( !fontHasSymbols.Contains(fontName))
{
fontHasSymbols.Add(fontName);
// Found symbol font
_MyLog.InfoFormat("Font '{0}' has Symbols", fontName);
}
//Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
//return true;
}
else
return myRange.Font.Name;
offset = newOffset;
alreadyProcessed.Add(problem.Value);
}
}
return null;
}
}
/// <summary>
/// Debug Tool - Return a string containing a list of the fonts that have symbol characters.
/// </summary>
public string FontsHaveSymbolCharacters
{
get
{
string sep = "";
StringBuilder sb = new StringBuilder();
List<string> fonts=new List<string>();
LBRange myRange = Range();
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
myRange.Start = 0;
int end = myRange.End;
string myText = GetRangeText(myRange);
//return _RegFindSymbol.IsMatch(myText);
MatchCollection problems = _RegFindSymbol.Matches(myText);
int offset = 0;
foreach (Match problem in problems)
{
myRange.Start = problem.Index + offset;
myRange.End = problem.Index + problem.Length + offset;
int newOffset = FindRangeOffset(myRange, problem, offset, end);
if (!fonts.Contains(myRange.Font.Name))
{
fonts.Add(myRange.Font.Name);
sb.Append(sep + "'" + myRange.Font.Name + "'");
sep = ",";
}
offset = newOffset;
}
if (sb.Length > 0) return sb.ToString();
return null;
}
}
/// <summary>
/// Debug Tool - Return a list of symbol characters using VESYMB font.
/// </summary>
public string FontsHaveSymbolCharacters2
{
get
{
try
{
Dictionary<string, List<int>> fonts = new Dictionary<string, List<int>>();
LBRange myRange = Range();
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
myRange.Start = 0;
int end = myRange.End;
string myText = GetRangeText(myRange);
//return _RegFindSymbol.IsMatch(myText);
MatchCollection problems = _RegFindSymbol.Matches(myText);
int offset = 0;
foreach (Match problem in problems)
{
myRange.Start = problem.Index + offset;
myRange.End = problem.Index + problem.Length + offset;
int newOffset = FindRangeOffset(myRange, problem, offset, end);
string sFont = myRange.Font.Name;
if (sFont.ToUpper().StartsWith("VESYM"))
{
if (!fonts.ContainsKey(sFont))
{
fonts.Add(sFont, new List<int>());
}
List<int> symbols = fonts[sFont];
string myTextSymb = GetRangeText(myRange);
foreach (char c in myTextSymb)
{
if (!symbols.Contains((int)c))
symbols.Add((int)c);
}
}
offset = newOffset;
}
if (fonts.Count > 0)
{
string sep = "";
StringBuilder sb = new StringBuilder();
foreach (string font in fonts.Keys)
{
sb.Append(sep + "'" + font + "'");
sep = ",";
foreach (int i in fonts[font])
{
sb.Append(sep);
sb.Append(i);
}
}
return sb.ToString();
}
}
catch (Exception ex)
{
Console.WriteLine("{0},{1},{2}", ex.GetType().Name, ex.Message, ex.StackTrace);
}
return null;
}
}
/// <summary>
/// Checks to see if the document contains symbol characters
@@ -601,86 +457,7 @@ namespace LBWordLibrary
}
}
Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
/// <summary>
/// FixSymbolCharacters - Fix any symbol characters in the document
/// </summary>
public void FixSymbolCharacters()
{
// Set up range object to be used to process text
LBRange myRange = Range();
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
int end = myRange.End;
myRange.Start = 0;
string myText = GetRangeText(myRange);
MatchCollection problems = _RegFindSymbol.Matches(myText);
int offset = 0;
foreach (Match problem in problems)
{
myRange.Start = problem.Index + offset;
myRange.End = problem.Index + problem.Length + offset;
int newOffset = FindRangeOffset(myRange, problem, offset, end);
if (myRange.Font.Name == "")
{
int wrdStart = myRange.Start;
int wrdEnd = myRange.End;
int wrdMiddle = wrdStart;
while (myRange.Font.Name == "")
{
do
{
myRange.End = ++wrdMiddle;
} while(myRange.Font.Name != "");
myRange.End = wrdMiddle - 1;
ReplaceSymbolCharacters(myRange);
myRange.Start = wrdMiddle -1;
myRange.End = wrdEnd;
}
ReplaceSymbolCharacters(myRange);
}
else
{
ReplaceSymbolCharacters(myRange);
}
offset = newOffset;
}
}
/// <summary>
/// Try to fix the first character in the symbol range F000 to F0FF. If it cannot be
/// fixed, it is an indicator that the font is not installed properly. Regardless of
/// whether there is success, the change is undone so that the document will not be
/// considered dirty, i.e. will not prompt user for save.
/// </summary>
/// <returns></returns>
public bool AttemptToFixASymbolCharacter()
{
// Set up range object to be used to process text
LBRange myRange = Range();
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
int end = myRange.End;
myRange.Start = 0;
string myText = GetRangeText(myRange);
MatchCollection problems = _RegFindSymbol.Matches(myText);
if (problems.Count>0)
{
Match problem = problems[0];
myRange.Start = problem.Index;
myRange.End = myRange.Start + 1;
if (IsSymbolFont(myRange.Font.Name)) return true; // if it's a symbol font already, no issue.
string before = GetRangeText(myRange);
string updated = ReplaceSymbolCharacters(before);
myRange.Text = updated;
string after = GetRangeText(myRange);
Undo(1);
//Console.WriteLine("Undo1 results = {0}", tst);
//tst = Undo(1);
//Console.WriteLine("Undo2 results = {0}", tst);
//tst = Undo(1);
//Console.WriteLine("Undo3 results = {0}", tst);
return (updated == after);
}
return true;
}
/// <summary>
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
/// </summary>
@@ -737,35 +514,6 @@ namespace LBWordLibrary
return myRange.Start - problem.Index;
}
/// <summary>
/// ReplaceSymbolCharacters Replaces any symbol characters in the specified range
/// </summary>
/// <param name="myRange"></param>
private static void ReplaceSymbolCharacters(LBRange myRange)
{
try
{
if (IsSymbolFont(myRange.Font.Name))
return;
string before = GetRangeText(myRange);
string updated = ReplaceSymbolCharacters(before);
myRange.Text = updated;
string after = GetRangeText(myRange);
if (after != updated) // If the Word text doesn't match try including a character before and after and do it again.
{
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}','{3}','{4}'", myRange.Start, myRange.End, before, updated, after);
int end = myRange.End;
myRange.Start = myRange.Start - 1;
myRange.End = end + 1;
myRange.Text = ReplaceSymbolCharacters(GetRangeText(myRange));
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}'", myRange.Start, myRange.End, GetRangeText(myRange));
}
}
catch (Exception ex)
{
Console.WriteLine("'TryEntireRange Exception',{0},{1},'{2}'", myRange.Start, myRange.End, ex.Message);
}
}
/// <summary>
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
/// </summary>
/// <param name="str"></param>
@@ -418,7 +418,7 @@ namespace ROEditor
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
// The data path the was passed in.
// The data path the was passed in.
DbConnectPath = PassedInPath;
// Setup the context menu
@@ -2844,7 +2844,8 @@ namespace ROEditor
}
else
{
newt=null;
mnutitle = Regex.Replace(mnutitle, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022
newt =null;
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
}
@@ -116,12 +116,12 @@ namespace ROEditor
public uint thisoff;
public string title;
public FstTmpSTRC(ushort type, uint offset, string tl)
public FstTmpSTRC(ushort type, uint offset, string tl)
{
thistype = type;
thisoff = offset;
title = tl;
}
}
void WriteString(BinaryWriter bw, string str)
{
@@ -150,7 +150,7 @@ namespace ROEditor
bw.Write(thisoff);
bw.Write(thistype);
WriteString(bw,title);
}
}
}
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
@@ -565,8 +565,8 @@ namespace ROEditor
string RecIdStr = elem.GetAttribute("RecID");
curRecID = System.Convert.ToUInt32(RecIdStr,16);
// Get the current node's parent id
string ParIdStr = elem.GetAttribute("ParentID");
// Get the current node's parent id
string ParIdStr = elem.GetAttribute("ParentID");
elemParentID = Convert.ToUInt32(ParIdStr,16);
string HasKids = elem.GetAttribute("HasChild");
@@ -771,8 +771,8 @@ namespace ROEditor
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
{
ushort RtnVal;
uint startFST = (uint)fhFST.BaseStream.Position;
uint RORecID;
uint startFST = (uint)fhFST.BaseStream.Position;
uint RORecID;
uint ParID;
byte nullbyte=0;
@@ -844,8 +844,12 @@ namespace ROEditor
AccPageID = " ";
WriteString(AccPageID);
// Save the ID and offset entry for the current ID
IdsAndOffsets.Add(RORecID,startFST);
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
string moddt = ROdatabase.RODB_GetModDateTime(elem.GetAttribute("RecID"), elem.GetAttribute("Table"));
if (!string.IsNullOrEmpty(moddt)) WriteString(moddt);
// Save the ID and offset entry for the current ID
IdsAndOffsets.Add(RORecID, startFST);
// Save the RecID and Accessory Page id
IdsAndAccPgIds[AccPageID] = RORecID;
@@ -322,9 +322,9 @@ namespace RODBInterface
get { return _PCChildList; }
set { _PCChildList = value; }
}
#endregion
#region abstracts // need these for each method that must be defined for each database type
public abstract string RODB_GetNextGroupTable();
#endregion
#region abstracts // need these for each method that must be defined for each database type
public abstract string RODB_GetNextGroupTable();
public abstract string RODB_GetNextRecId(string table);
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
@@ -355,9 +355,10 @@ namespace RODBInterface
public abstract string RODB_GetDBServerForAbout();
public abstract string RODB_HasBeenConverted();
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
#endregion
public abstract string RODB_GetModDateTime(string Recid, string table);
#endregion
public RODB()
public RODB()
{
}
@@ -2382,9 +2383,9 @@ namespace RODBInterface
RecID = DBE.GetString(0);
MyRecID = RecID;
Info = DBE.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -2425,7 +2426,7 @@ namespace RODBInterface
return retlist;
}
public override string RODB_GetSchemaPiece(string Recid, string table)
public override string RODB_GetSchemaPiece(string Recid, string table)
{
string strGetSchemaPiece;
string Info;
@@ -3082,7 +3083,28 @@ namespace RODBInterface
return GrpCnt;
}
}
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Get the Modification Date / Time for the RO
public override string RODB_GetModDateTime(string Recid, string table)
{
using (System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection(strDatabaseConnectionCommand))
{
connection.Open();
using (System.Data.OleDb.OleDbCommand command = connection.CreateCommand())
{
//Unfortunately Access wont let you paramaterize the table name
command.CommandText = $"SELECT ModDateTime FROM {Regex.Replace(table, "[^a-zA-Z0-9]", "")} WHERE RecID = @Value";
command.Parameters.Add(new System.Data.OleDb.OleDbParameter
{
OleDbType = System.Data.OleDb.OleDbType.VarChar,
ParameterName = "@Value",
Value = Recid
});
return command.ExecuteScalar().ToString();
}
}
}
}
}
@@ -1803,9 +1803,9 @@ namespace RODBInterface
RecID = reader.GetString(0);
MyRecID = RecID;
Info = reader.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -1859,9 +1859,9 @@ namespace RODBInterface
RecID = reader.GetString(0);
MyRecID = RecID;
Info = reader.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -2653,8 +2653,36 @@ namespace RODBInterface
}
return GrpCnt;
}
#endregion
public static bool TestConnect(string constring)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Get the Modification Date / Time for the RO
public override string RODB_GetModDateTime(string Recid, string table)
{
using (SqlConnection connection = new SqlConnection(strDatabaseConnectionCommand))
{
connection.Open();
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = $"SELECT ModDateTime FROM ROALL WHERE RecID = @Value AND ROTable = @table";
command.Parameters.Add(new SqlParameter
{
SqlDbType = SqlDbType.VarChar,
ParameterName = "@Value",
Value = Recid
});
command.Parameters.Add(new SqlParameter
{
SqlDbType = SqlDbType.VarChar,
ParameterName = "@table",
Value = table
});
return command.ExecuteScalar().ToString();
}
}
}
#endregion
public static bool TestConnect(string constring)
{
bool success = false;
using (SqlConnection connection = new SqlConnection(constring))
@@ -0,0 +1,147 @@
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2026 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/20/2026
-- Description: Script to consolidate Cover Pages for Barakah
-- by Converting multi-unit procedures with Cover Pages
-- to use 1 Library Document Cover Page
-- =============================================
select Contents.ContentID
, Contenttext = Contents.Text
, Items.ItemID
, tblDocuments.DocID
, ParentContentID
, ParentItemID
, LibTitle = ISNULL(LibTitle,'')
, numLibCP
, numCP
,BaseFlag = 0
INTO #tmpUpdate
from Contents
inner join Entries on Contents.ContentID = Entries.ContentID
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
inner join Items on Items.ContentID = Contents.ContentID
outer apply
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
where PItm.ItemID <> Items.ItemID
) parent
outer apply
(select numLibCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
) childWithLibTitle
outer apply
(select numCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%'
) child
where Contents.text like 'Cover Page%'
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
where BaseFlag = 0 AND tU.ContentID IN
(
Select ContentID FROM
(SELECT sub.ContentID,
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
FROM #tmpUpdate sub
) x
WHERE x.pos = 1
)
declare @Cont TABLE
(
ContentID int,
ItemID int,
xConfig xml
)
insert into @Cont
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
tblContents
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
where tU.BaseFlag > 0
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
@Cont CNT INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID;
--Update items PreviousIds
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
FROM
tblItems
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblItems ON tU.ContentID = tblItems.ContentID
WHERE tU.BaseFlag = 0;
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblContents ON tU.ContentID = tblContents.ContentID
WHERE tU.BaseFlag = 0;
DELETE FROM
tblEntries
FROM
tblEntries
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
WHERE tU.BaseFlag in (0,2);
INSERT INTO [dbo].[tblEntries]
([ContentID]
,[DocID]
,[DTS]
,[UserID]
,[DeleteStatus])
SELECT
DISTINCT tU.ContentID,
766, -- docid 766 "Cover Page 1"
GETDATE(),
'CPVolian2026',
0
FROM
#tmpUpdate tU
INNER JOIN
@Cont CNT ON tU.ContentID = CNT.ContentID
WHERE tU.BaseFlag = 2;
drop table #tmpUpdate;
IF (@@Error = 0) SELECT '[Barakah Cover Page Consolidation] Succeeded'
ELSE SELECT '[Barakah Cover Page Consolidation] Error'
go
@@ -0,0 +1,263 @@
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/20/2026
-- Description: Script to consolidate Cover Pages for Barakah
-- by Converting multi-unit procedures with Cover Pages
-- to use 1 Library Document Cover Page
-- =============================================
----@isTest = 0 will change data
----@isTest = 1 for internal testing (no data will be changed)
DECLARE @isTest bit = 1;
----Per Cover Page, pull how many cover pages
----Each Cover Page's procedure has
----and how many of those are library documents
select Contents.ContentID
, Contenttext = Contents.Text
, Items.ItemID
, tblDocuments.DocID
, ParentContentID
, ParentItemID
, LibTitle = ISNULL(LibTitle,'')
, numLibCP
, numCP
,BaseFlag = 0
INTO #tmpUpdate
from Contents
inner join Entries on Contents.ContentID = Entries.ContentID
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
inner join Items on Items.ContentID = Contents.ContentID
outer apply
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
where PItm.ItemID <> Items.ItemID
) parent
outer apply
(select numLibCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
) childWithLibTitle
outer apply
(select numCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%'
) child
where Contents.text like 'Cover Page%'
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
--BaseFlag
-- 0 = a Cover Page that will be deleted
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
---- If only 1 Library Doc CP for the CP's procedure and this is it, then mark this CP as the one we will keep
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
---- If multiple Library Document CPs, pick the first one as the one we will keep (BaseFlag = 1)
---- If no Library Document CPs, pick the first one as the one we will repurpose (BaseFlag = 2)
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
where BaseFlag = 0 AND tU.ContentID IN
(
Select ContentID FROM
(SELECT sub.ContentID,
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
FROM #tmpUpdate sub
) x
WHERE x.pos = 1
)
----BEGIN TESTS--
if(@isTest = 1)
BEGIN
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
OUTER APPLY
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
FROM #tmpUpdate sub
where sub.ParentContentID = TU.ParentContentID
) sub
where numBaseFlagSet <> 1
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0 and BaseFlag = 1
select Count(*), 'Should be Zero - at least 1 Lib Docs, BaseFlag is 2' FROM #tmpUpdate TU
where numLibCP > 0 and BaseFlag = 2
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 1 for that Lib doc' FROM #tmpUpdate TU
where numLibCP = 1 and LibTitle <> '' and BaseFlag <> 1
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 0 for ones without Lib Doc' FROM #tmpUpdate TU
where numLibCP = 1 and LibTitle = '' and BaseFlag <> 0
select Count(*), 'Should be Zero - 1 CP, no Lib Docs, BaseFlag not 2' FROM #tmpUpdate TU
where numLibCP = 0 and numCP = 1 and BaseFlag <> 2
select Count(*), 'Should be Zero - more than 1 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0 and BaseFlag = 1
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
OUTER APPLY
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
FROM #tmpUpdate sub
where sub.ParentContentID = TU.ParentContentID
) sub
where numBaseFlagSet <> 1
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0
and BaseFlag = 1
--all Parents should have exactly 1 Baseflag=1 or BaseFlage = 2
select 'Should be No Records where not a BaseFlag 1 or 2'
select NumNotBaseFlag12 = Count(*)
FROM #tmpUpdate TU
Group by ParentContentID
HAVING SUM(CASE WHEN BaseFlag in (1,2) THEN 1 ELSE 0 END) <> 1
select 'Should be No Records where with both a BaseFlag 1 and 2'
select NumBothBaseFlag12 = Count(*)
FROM #tmpUpdate TU
Group by ParentContentID
HAVING SUM(BaseFlag) > 2
END
--END TESTS--
--BaseFlag
-- 0 = a Cover Page that will be deleted
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
----Update config for Coverpage 1 to remove <MasterSlave Applicability="1" />
----from that config
----cover page 1s
declare @Cont TABLE
(
ContentID int,
ItemID int,
xConfig xml
)
insert into @Cont
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
tblContents
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
where tU.BaseFlag > 0
if(@isTest = 1)
BEGIN
select WRD='Have Masterslave in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
END
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
if(@isTest = 1)
BEGIN
select WRD='None should have Masterslave Removed in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
select 'Show Records and how the ids will be re-linked'
Select tblItems.ItemID, tblItems.ContentID, tblItems.PreviousID, tblContents.Text,
PreviousItemID = tU.ItemID, PreviousContentID = tU.ContentID, PreviousText = tUCont.Text,
RelinkToItemID = IdToSwapTO.ItemID, RelinkToContentID = IdToSwapTO.ContentID, RelinkToText = IdToSwapTOCont.Text
FROM
tblItems
INNER JOIN
tblContents on tblContents.ContentID = tblItems.ContentID
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN
tblContents tUCont on tUCont.ContentID = tU.ContentID
LEFT OUTER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
LEFT OUTER JOIN tblContents IdToSwapTOCont on IdToSwapTOCont.ContentID = IdToSwapTO.ContentID
END
ELSE
BEGIN
--Update Config for Contents and set Text = 'Cover Page'
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
@Cont CNT INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID;
--Update items PreviousIds
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
FROM
tblItems
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
--delete where BaseFlag = 0 ---Items,Content,Entries, --set DeleteStatus = 1
--these are ones that will be replaced by a library document
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblItems ON tU.ContentID = tblItems.ContentID
WHERE tU.BaseFlag = 0;
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblContents ON tU.ContentID = tblContents.ContentID
WHERE tU.BaseFlag = 0;
--delete entries where Baseflag = 2
--create new entries where Baseflag = 2
DELETE FROM
tblEntries
FROM
tblEntries
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
WHERE tU.BaseFlag in (0,2);
INSERT INTO [dbo].[tblEntries]
([ContentID]
,[DocID]
,[DTS]
,[UserID]
,[DeleteStatus])
SELECT
DISTINCT tU.ContentID,
766, -- docid 766 "Cover Page 1"
GETDATE(),
'CPVolian2026',
0
FROM
#tmpUpdate tU
INNER JOIN
@Cont CNT ON tU.ContentID = CNT.ContentID
WHERE tU.BaseFlag = 2;
END;
drop table #tmpUpdate;
+1 -1
View File
@@ -1817,7 +1817,7 @@ ALTER trigger [dbo].[tr_Contents_Delete] on [dbo].[Contents] instead of delete a
select ii.ContentID,ii.Number,ii.Text,ii.Type,ii.FormatID,ii.Config,ii.DTS,ii.UserID,ii.DeleteStatus,ii.ActionDTS
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
where ii.DeleteStatus > 0
update ga set ga.contentauditid = (select max(auditid) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
update ga set ga.contentauditid = (select ISNULL(max(auditid),0) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
from gridaudits ga join deleted dd on ga.contentid = dd.contentid where ga.contentauditid = 0
end
go
+304 -46
View File
@@ -5227,7 +5227,7 @@ CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumberAndUnitID]
WITH EXECUTE AS OWNER
AS
declare @RevisionID int
set @RevisionID = (select revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID)
set @RevisionID = (select top 1 revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID order by revisionid desc)
SELECT
[RevisionID],
[ItemID],
@@ -5547,6 +5547,12 @@ ELSE PRINT 'Function: ve_GetItemDerivedApplicability Error on Creation'
GO
-------
-- =============================================
-- Author: Matthew Schill
-- Modify date: 07/14/2026
-- Description: Reworked ve_GetParentItem for Performance improvement
-- =============================================
/****** Object: UserDefinedFunction [dbo].[vefn_GetParentItem] Script Date: 03/28/2012 17:58:48 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ve_GetParentItem]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
DROP FUNCTION [ve_GetParentItem];
@@ -5555,35 +5561,46 @@ GO
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int
CREATE OR ALTER FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int
WITH EXECUTE AS OWNER
AS
BEGIN
DECLARE @ParentID int;
WITH Itemz([ItemID],[IsFound]) as
WITH Itemz([ItemID]) as
(
select ii.itemid,0 from items ii where ii.itemid = @ItemID
select ii.itemid from items ii WITH (NOLOCK) where ii.itemid = @ItemID
union all
select ii.previousid,0 from items ii
select ii.previousid from items ii WITH (NOLOCK)
join itemz zz on ii.itemid = zz.itemid
where ii.previousid is not null
and zz.isfound = 0
union all
select ii.itemid,1
from parts pp
join itemz zz on pp.itemid = zz.itemid
join items ii on ii.contentid = pp.contentid
)
select top 1 @ParentID = itemid from itemz
where isfound = 1 OPTION (MAXRECURSION 10000)
select top 1 @ParentID = ii.itemid
from itemz
inner join parts pp WITH (NOLOCK) on pp.itemid = itemz.itemid
inner join items ii WITH (NOLOCK) on ii.contentid = pp.contentid
OPTION (MAXRECURSION 10000)
RETURN @ParentID
END
GO
IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetParentItem] Succeeded'
ELSE PRINT 'ScalerFunction [vefn_GetParentItem] Error on Creation'
go
IF EXISTS (SELECT * FROM dbo.sysIndexes WHERE name like 'IX_PartsItemID')
DROP INDEX [IX_PartsItemID] ON [dbo].[tblParts];
GO
CREATE NONCLUSTERED INDEX IX_PartsItemID
ON [dbo].[tblParts] ([ItemID] ASC)
INCLUDE([ContentID],[DeleteStatus],[FromType]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
PRINT 'Added IX_PartsItemID Index. Speeds up Getting Parent Items'
GO
/****** Object: UserDefinedFunction [dbo].[vefn_CanTransitionBeCreated] Script Date: 10/14/2012 02:03:30 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_CanTransitionBeCreated]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
DROP FUNCTION [vefn_CanTransitionBeCreated];
@@ -13540,35 +13557,7 @@ GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVersionPdfs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [deleteAllDocVersionPdfs];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2017 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[deleteAllDocVersionPdfs]
(
@VersionID int
)
WITH EXECUTE AS OWNER
AS
BEGIN TRY -- Try Block
BEGIN TRANSACTION
DELETE [Pdfs]
WHERE [DocID] IN(select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
Join Entries EE ON EE.ContentID= VI.ContentID)
IF( @@TRANCOUNT > 0 ) COMMIT
END TRY
BEGIN CATCH -- Catch Block
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
EXEC vlnErrorHandler
END CATCH
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: deleteAllDocVersionPdfs Succeeded'
ELSE PRINT 'Procedure Creation: deleteAllDocVersionPdfs Error on Creation'
GO
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
@@ -17169,6 +17158,7 @@ GO
[roid] [varchar](50) NOT NULL,
[appid] [varchar](max) NULL,
[value] [varchar](max) NULL,
[moddatetime] [datetime] NULL,
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
(
[RofstChildID] ASC
@@ -17303,6 +17293,23 @@ GO
End -- Rofst Tables
Go
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/30/2026
-- Description: Store RO Modification date/time
-- =============================================
--- Add Column to store RO Modification date/time if it does not already exist
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'RofstChild'
AND COLUMN_NAME = 'moddatetime')
ALTER TABLE RofstChild ADD moddatetime datetime NULL;
go
-- Display the status
IF (@@Error = 0) PRINT 'Altered table [RofstChild] Succeeded for moddatetime'
ELSE PRINT 'Altered table [RofstChild] Error on Alter for moddatetime'
go
/*
----------------------------------------------------------------------------------
@@ -19705,6 +19712,7 @@ GO
@roid VarChar(50),
@appid VarChar(Max) = null,
@value VarChar(Max) = null,
@ModDateTime DateTime = null,
@missingDefaultValue VarChar(Max) = null
)
With Execute as Owner
@@ -19722,8 +19730,8 @@ GO
Set @missingDefaultValue = '[TBD]';
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value])
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, @ModDateTime, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
-- Check for appid, if exists, then insert the default value for each return type if multi-value
@@ -24753,7 +24761,7 @@ BEGIN
select Docs.DocID, UnitID, SectionID = MIN(SectionID)
FROM
(SELECT DISTINCT [DocID]
FROM [VEPROMS_Barakah].[dbo].[tblDocuments]) Docs
FROM [tblDocuments]) Docs
INNER JOIN Entries on Docs.DocID = Entries.DocID
INNER JOIN Contents on Entries.ContentID = Contents.ContentID
inner join Items on Items.ContentID = Contents.ContentID
@@ -24777,6 +24785,256 @@ IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded'
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_ROFST_changes]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1)
DROP FUNCTION [vefn_ROFST_changes];
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Function for ROs that updated in latest RO FST Load
==========================================================================================================
*/
CREATE FUNCTION [dbo].[vefn_ROFST_changes](@OrigFSTID int, @NewFSTid int, @VersionID int)
RETURNS @ROIDs TABLE
(
[roid] varchar(50)
)
WITH EXECUTE AS OWNER
AS
BEGIN
insert into @ROIDs
SELECT DISTINCT ISNULL(RofstChild.roid,previous.roid)
FROM
(SELECT * FROM RofstChild where RofstChild.RofstID = @NewFSTid) RofstChild
FULL OUTER JOIN
(SELECT * FROM RofstChild previous where previous.RofstID = @OrigFSTID) previous
ON previous.dbiID = RofstChild.dbiID AND previous.ID = RofstChild.ID
where
ISNULL(previous.RofstID,'') != ISNULL(RofstChild.RofstID,'')
AND
(
(RofstChild.RofstID = @NewFSTid OR RofstChild.RofstID IS NULL)
AND
(previous.RofstID = @OrigFSTID OR previous.RofstID IS NULL)
)
AND
(previous.moddatetime IS NULL
OR RofstChild.moddatetime IS NULL
OR RofstChild.moddatetime != previous.moddatetime
OR RofstChild.title != previous.title
OR RofstChild.value != previous.value
)
RETURN
END
go
IF (@@Error = 0) PRINT 'TableFunction [vefn_ROFST_changes] Succeeded'
ELSE PRINT 'TableFunction [vefn_ROFST_changes] Error on Creation'
go
/****** Object: StoredProcedure [deleteDocVersionPdfsWithNewROs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteDocVersionPdfsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [deleteDocVersionPdfsWithNewROs];
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Delete all PDFs with ROs that will need re-resolved
==========================================================================================================
*/
CREATE PROCEDURE [dbo].[deleteDocVersionPdfsWithNewROs]
(
@VersionID int,
@OrigFSTid int,
@NewFSTid int
)
WITH EXECUTE AS OWNER
AS
BEGIN
DELETE [Pdfs]
WHERE [DocID] IN
(
select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
Join Entries EE ON EE.ContentID= VI.ContentID
Join DRoUsages ON DRoUsages.DocID = EE.DocID
Join dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes on LEFT(DRoUsages.ROID,12) = ROFST_changes.roid
)
RETURN
END
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Succeeded'
ELSE PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Error on Creation'
GO
/****** Object: StoredProcedure [getItemsWithNewROs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getItemsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [getItemsWithNewROs];
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Get Items with New ROs that will need resolved
==========================================================================================================
*/
CREATE PROCEDURE [dbo].[getItemsWithNewROs]
(
@VersionID int,
@OrigFSTid int,
@NewFSTid int
)
WITH EXECUTE AS OWNER
AS
BEGIN
select DISTINCT tblItems.ItemID FROM
dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes
INNER JOIN RoUsages ON LEFT(RoUsages.ROID,12) = ROFST_changes.roid
INNER JOIN tblItems ON RoUsages.ContentID = tblItems.ContentID
OUTER APPLY (Select VersionID = dbo.vefn_GetVersionIDByItemID(tblItems.ItemID)) ver
INNER JOIN DocVersions DV ON DV.VersionID = ver.VersionID
INNER JOIN Associations ON Associations.VersionID = DV.VersionID
where ver.VersionID = @VersionID
RETURN
END
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getItemsWithNewROs Succeeded'
ELSE PRINT 'Procedure Creation: getItemsWithNewROs Error on Creation'
GO
/****** Object: StoredProcedure [dbo].[getRevisionByItemIDandRevisionNumber] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[getRevisionByItemIDandRevisionNumber]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber];
GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber]
(
@ItemID int,
@RevisionNumber nvarchar(50)
)
WITH EXECUTE AS OWNER
AS
declare @RevisionID int
set @RevisionID = (select top 1 revisionid from revisions where itemid = @itemid and revisionnumber = @RevisionNumber order by revisionid desc)
SELECT
[RevisionID],
[ItemID],
[TypeID],
[RevisionNumber],
[RevisionDate],
[Notes],
[Config],
[DTS],
[UserID],
[LastChanged],
(SELECT COUNT(*) FROM [Checks] WHERE [Checks].[RevisionID]=[Revisions].[RevisionID]) [CheckCount],
(SELECT COUNT(*) FROM [Versions] WHERE [Versions].[RevisionID]=[Revisions].[RevisionID]) [VersionCount]
FROM [Revisions]
WHERE [RevisionID]=@RevisionID
SELECT
[Checks].[CheckID],
[Checks].[RevisionID],
[Checks].[StageID],
[Checks].[ConsistencyChecks],
[Checks].[DTS],
[Checks].[UserID],
[Checks].[LastChanged],
[Stages].[Name] [Stage_Name],
[Stages].[Description] [Stage_Description],
[Stages].[IsApproved] [Stage_IsApproved],
[Stages].[DTS] [Stage_DTS],
[Stages].[UserID] [Stage_UserID]
FROM [Checks]
JOIN [Stages] ON
[Stages].[StageID]=[Checks].[StageID]
WHERE
[Checks].[RevisionID]=@RevisionID
SELECT
[Versions].[VersionID],
[Versions].[RevisionID],
[Versions].[StageID],
[Versions].[DTS],
[Versions].[UserID],
[Versions].[LastChanged],
[Versions].[PDF],
[Versions].[SummaryPDF],
[Stages].[Name] [Stage_Name],
[Stages].[Description] [Stage_Description],
[Stages].[IsApproved] [Stage_IsApproved],
[Stages].[DTS] [Stage_DTS],
[Stages].[UserID] [Stage_UserID]
FROM [Versions]
JOIN [Stages] ON
[Stages].[StageID]=[Versions].[StageID]
WHERE
[Versions].[RevisionID]=@RevisionID
RETURN
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Succeeded'
ELSE PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Error on Creation'
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 06/29/2026
Description: Added an ISNULL check when setting GridAudits.contentauditid.
Was Causing Deletion of some Grids to fail.
==========================================================================================================
*/
/****** Object: Trigger [tr_Contents_Delete] ******/
ALTER trigger [dbo].[tr_Contents_Delete] on [dbo].[Contents] instead of delete as
begin
update ii set DeleteStatus = (select max(DeleteID) from DeleteLog where SPID = @@spid), ActionDTS = getdate(),
UserID = (select top 1 UserID from DeleteLog where SPID = @@spid order by deleteid desc)
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
insert into ContentAudits(ContentID,Number,Text,Type,FormatID,Config,DTS,UserID,DeleteStatus,ActionDTS)
select ii.ContentID,ii.Number,ii.Text,ii.Type,ii.FormatID,ii.Config,ii.DTS,ii.UserID,ii.DeleteStatus,ii.ActionDTS
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
where ii.DeleteStatus > 0
update ga set ga.contentauditid = (select ISNULL(max(auditid),0) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
from gridaudits ga join deleted dd on ga.contentid = dd.contentid where ga.contentauditid = 0
end
go
-- Display the status of Trigger alter
IF (@@Error = 0) PRINT 'Trigger Alteration: tr_Contents_Delete Succeeded'
ELSE PRINT 'Trigger Alteration: tr_Contents_Delete Error on Creation'
GO
/*
---------------------------------------------------------------------------
| ADD New Code Before this Block |
@@ -24810,8 +25068,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '03/13/2026 7:00 AM'
set @RevDescription = 'Added Get Missing Docs by Unit for Generating Pdf table'
set @RevDate = '07/16/2026 8:30 AM'
set @RevDescription = 'Reworked ve_GetParentItem for Performance improvement'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
File diff suppressed because it is too large Load Diff
@@ -947,14 +947,16 @@ namespace VEPROMS
pi = AddProcedure(xd.DocumentElement, dvi, pi);
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
}
DirectoryInfo di = new DirectoryInfo(PEIPath);
DirectoryInfo[] dis = di.GetDirectories();
for (int d = 0; d < dis.Length; d++)
dis[d].Delete(true);
lblImportStatus.Text = "Updating Transitions";
AddTransitions();
FixFloatingFoldouts();
SaveTransitionAndItemContentIDs();
// B2026-034 remove the folders created from un-ziping the import set file - this was done prior to updating transitions
// so if there was an issue deleting these temporay folders and files, the actual importing will be completed
DirectoryInfo di = new DirectoryInfo(PEIPath);
DirectoryInfo[] dis = di.GetDirectories();
for (int d = 0; d < dis.Length; d++)
dis[d].Delete(true);
return true;
}
}
@@ -68,8 +68,26 @@ namespace VEPROMS
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({ dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
//CSM C2026-014 if multi-unit, set for each unit
System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID);
if (RevisionData.HasUnits(dt))
{
//Change the ChangeBarDate for each unit
foreach (DataRow r in dt.Rows)
{
if (!r.IsNull("UnitID"))
{
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
}
}
MyProcConfig.SelectedSlave = 0;
}
}
@@ -108,7 +126,10 @@ namespace VEPROMS
sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS}).");
foreach (DataRow r in dt.Rows)
{
sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}).");
if (!r.IsNull("UnitID"))
{
sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}).");
}
}
sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals).");
@@ -121,12 +142,14 @@ namespace VEPROMS
//Change the ChangeBarDate for each unit
foreach (DataRow r in dt.Rows)
{
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss");
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
if (!r.IsNull("UnitID"))
{
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss");
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
}
}
MyProcConfig.SelectedSlave = 0;
DialogResult = DialogResult.OK;
+3 -2
View File
@@ -1317,11 +1317,12 @@
this.swRegenWordAttmts.Name = "swRegenWordAttmts";
this.swRegenWordAttmts.Size = new System.Drawing.Size(91, 22);
this.swRegenWordAttmts.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200)));
this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250)));
this.swRegenWordAttmts.SwitchClickTogglesValue = true;
this.swRegenWordAttmts.TabIndex = 34;
this.swRegenWordAttmts.Value = true;
this.swRegenWordAttmts.ValueObject = "Y";
this.swRegenWordAttmts.ValueChanged += new System.EventHandler(this.swCk_ValueChanged);
//
// labelX1
//
@@ -1334,7 +1335,7 @@
this.labelX1.Location = new System.Drawing.Point(107, 150);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(186, 22);
this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200)));
this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250)));
this.labelX1.TabIndex = 33;
this.labelX1.Text = "Generate Missing Word Attachments";
//
@@ -1036,8 +1036,11 @@ namespace VEPROMS
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath))
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath))
{
ProgressBar.ColorTable = eProgressBarItemColor.Error;
FinalProgressBarMessage = "No existing RO.FST";
@@ -1063,9 +1066,29 @@ namespace VEPROMS
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
else if (!dv.ROfstLastCompleted && origfstid == roFstInfo.ROFstID)
{
//Handle issue where load failed without completing update
//previous RO FST did not load, get last loaded ID
//if none, use -1 which will check all ROs in the Working Draft
string cfg = dv.DocVersionAssociations[0].Config;
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
if (dv.DocVersionAssociations[0]?.MyROFst != null)
{
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
{
origfstid = -1;
}
}
else
{
origfstid = -1;
}
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
}
Cursor = Cursors.Default;
@@ -1316,10 +1339,10 @@ namespace VEPROMS
{
if (ProgressBar == null) return;
ProgressBar.Value = 100;
ProgressBar.Maximum = 100;
ProgressBar.Text = value;
txtProcess.AppendText(value);
ProgressBar.Text = value;
ProgressBar.Maximum = 100;
ProgressBar.Value = 100;
txtProcess.AppendText(value);
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
@@ -121,15 +121,15 @@
<value>17, 17</value>
</metadata>
<data name="swRegenWordAttmts.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
</value>
</data>
<data name="labelX1.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
This function will generate (and save) any missing saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
</value>
</data>
<data name="swRefreshTblsForSrch.SuperTooltip" xml:space="preserve">
@@ -183,7 +183,7 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab
Be sure a current backup exists prior to running this function!!</value>
</data>
<data name="swRefreshWordAttmts.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
</value>
@@ -202,9 +202,9 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab
Be sure a current backup exists prior to running this function!!</value>
</data>
<data name="labelX5.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
This function will remove all of the saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
</value>
</data>
<data name="labelX9.SuperTooltip" xml:space="preserve">
+1 -12
View File
@@ -83,7 +83,6 @@ namespace VEPROMS
this.lblUser = new DevComponents.DotNetBar.LabelItem();
this.lblLastChange = new DevComponents.DotNetBar.LabelItem();
this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem();
this.btnFixMSWord = new DevComponents.DotNetBar.ButtonItem();
this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel();
this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails();
this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX();
@@ -541,8 +540,7 @@ namespace VEPROMS
this.btnEditItem,
this.lblUser,
this.lblLastChange,
this.btnStepRTF,
this.btnFixMSWord});
this.btnStepRTF});
this.bottomBar.Location = new System.Drawing.Point(5, 573);
this.bottomBar.Name = "bottomBar";
this.bottomBar.Size = new System.Drawing.Size(1185, 25);
@@ -728,14 +726,6 @@ namespace VEPROMS
this.btnStepRTF.Text = "Step RTF";
this.btnStepRTF.Click += new System.EventHandler(this.btnStepRTF_Click);
//
// btnFixMSWord
//
this.btnFixMSWord.ForeColor = System.Drawing.Color.Black;
this.btnFixMSWord.Name = "btnFixMSWord";
this.btnFixMSWord.Text = "Fix Symbol Fonts";
this.btnFixMSWord.Visible = false;
this.btnFixMSWord.Click += new System.EventHandler(this.btnFixMSWord_Click);
//
// epAnnotations
//
this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control;
@@ -1775,7 +1765,6 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnItemInfo;
private DevComponents.DotNetBar.ButtonItem btnFilter;
private DevComponents.DotNetBar.TextBoxItem txtFilter;
private DevComponents.DotNetBar.ButtonItem btnFixMSWord;
private Volian.Controls.Library.DisplayBookMarks displayBookMarks;
//private DevComponents.DotNetBar.LabelItem lblLocked;
private DevComponents.DotNetBar.ButtonItem btnShortCuts;
+101 -48
View File
@@ -234,7 +234,7 @@ namespace VEPROMS
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
SetupFolder(MyDocVersion.FolderID);
SetupFolder(MyDocVersion.FolderID);
tc.MySessionInfo = MyParent.MySessionInfo;
displaySearch1.TopFolderID = myDocVersion.FolderID;
SelectedDVI = myDocVersion;
@@ -245,13 +245,17 @@ namespace VEPROMS
displayBookMarks.SetupBookMarks(); // setup bookmarks in the child window
tc.MyCopyStep = myParent.tc.MyCopyStep; // copy the copystep info to the child window
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
tc.EnableDisableStepProperties -= EnableDisableStepProperties;
tc.EnableDisableStepProperties += new StepTabRibbonEvent(EnableDisableStepProperties);
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
}
public void OpenItem(ItemInfo myItemInfo)
{
tc.OpenItem(myItemInfo);
tc.OpenItem(myItemInfo);
}
public void RefreshItem(ItemInfo myItemInfo)
@@ -352,9 +356,10 @@ namespace VEPROMS
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
bottomProgBar.ValueChanged += new EventHandler(bottomProgBar_ValueChanged);
tc.EnableDisableStepProperties += new StepTabRibbonEvent(EnableDisableStepProperties);
// When creating an XY Plot, a System.Drawing.Graphics is needed and it requires a form. Use the main form.
if (VlnSettings.DebugMode)
// When creating an XY Plot, a System.Drawing.Graphics is needed and it requires a form. Use the main form.
if (VlnSettings.DebugMode)
{
MSWordToPDF.DebugStatus = 1;
MSWordToPDF.OverrideColor = Color.Red;
@@ -964,7 +969,18 @@ namespace VEPROMS
{
pnl.ApplDisplayMode = displayApplicability.ViewMode;
displayHistory.ApplDisplayMode = pnl.ApplDisplayMode;
//C2026-021 Expand Functionality of Viewing Mode
if (pnl.ApplDisplayMode > 0 && pnl.VwMode != E_ViewMode.View)
{
pnl.VwMode = E_ViewMode.View;
EnableDisableStepProperties(sender, new StepTabRibbonEventArgs(tc.SelectedDisplayTabItem.MyItemInfo, 0, pnl.VwMode));
MessageBox.Show("Changing to View Only Mode. Applicability Viewing Mode must be Master to return to Edit Mode. View Mode can be toggled off via the Ribbon->View tab.", "Changing to View Mode", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
pnl.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
}
}
void tv_ViewPDF(object sender, vlnTreeViewPdfArgs args)
@@ -1578,13 +1594,13 @@ namespace VEPROMS
}
else
{
SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
}
}
else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID)
{
SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
// need this to update RO Tree after UpdateRofst (B2015-226)
@@ -1592,9 +1608,9 @@ namespace VEPROMS
if (displayRO.MyROFST != SelectedROFst)
{
displayRO.MyROFST = SelectedROFst;
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
// true to LoadTree
displayRO.LoadTree(true);
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
// true to LoadTree
if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
}
}
@@ -2395,9 +2411,10 @@ namespace VEPROMS
tv.MySessionInfo = MySessionInfo;
tv.MyUserInfo = MyUserInfo;
StepTabRibbon.MySessionInfo = MySessionInfo;
displayRO.MySessionInfo = MySessionInfo;
// Initialize Caption with Server name and Database name.
SetCaption(tv.TopNode as VETreeNode);
// Initialize Caption with Server name and Database name.
SetCaption(tv.TopNode as VETreeNode);
System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false);
//System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession);
@@ -4482,7 +4499,6 @@ namespace VEPROMS
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabTags;
displayTags.HighlightChangeStep();
}
else if (args.PanelTabName == "Change Image Size")
{
@@ -4552,8 +4568,17 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// DisplayTab was changed
// need to clear the RTB selected
// without resetting the DVI or FST
// (those will be set manually / individually)
// this will prevent DVI and FST from changing to null then back again
// which will trigger reloads
displayRO.ClearRTB();
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
@@ -4562,9 +4587,24 @@ namespace VEPROMS
displayRO.MyROFST = null;
}
// B2022-026 RO Memory reduction coding (Jakes Merge)
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
displayRO.LoadTree(true);
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// set the DocVersionInfo so that the FST and docversion are in sync
SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion;
if (displayRO.MyDvi != SelectedDVI)
{
displayRO.MyDvi = SelectedDVI;
}
Application.DoEvents();
// B2022-026 RO Memory reduction coding (Jakes Merge)
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree(true))
{
SelectedROFst = displayRO.MyROFST;
}
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
@@ -4579,7 +4619,7 @@ namespace VEPROMS
// also change the text on the buttons to read either Find or Find/Replace
// also toggle the Replace tab on the dialog based on the user's accessibility to the procedure
bool isReviewer = !MyUserInfo.IsAllowedToEdit(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion);
pnl.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling(true);
pnl.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling();
this.dlgFindReplace.ToggleReplaceTab(isReviewer ? E_ViewMode.View : E_ViewMode.Edit);
pnl.MyStepTabPanel.MyStepTabRibbon.ToggleFindReplaceToolTip(isReviewer);
}
@@ -4628,8 +4668,6 @@ namespace VEPROMS
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
return;
btnFixMSWord.Visible = (args != null && (args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
@@ -4767,9 +4805,15 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.LoadTree();
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree())
{
SelectedROFst = displayRO.MyROFST;
}
displayBookMarks.MyEditItem = args.MyEditItem;
displayBookMarks.MyEditItem = args.MyEditItem;
displayHistory.MyEditItem = args.MyEditItem;
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View";
@@ -4797,7 +4841,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.SetFindDocROButton(false);
displayRO.LoadTree();
if (!_WeAreExitingPROMS) displayRO.LoadTree();
//C2019-036 View Only mode work with Checked Out Procedures
//In View Only Mode - Step Properties should be disabled
@@ -4838,15 +4882,31 @@ namespace VEPROMS
//In View Only Mode - Step Properties should be disabled
public void EnableDisableStepProperties(object sender, StepTabRibbonEventArgs args)
{
if (args.ViewMode == E_ViewMode.View && (infoTabs.Enabled || infoTabs.SelectedTab != infotabTags))
//C2026 - 021 Expand Functionality of Viewing Mode
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
if (args.ViewMode == E_ViewMode.View && (infotabControlPanelTags.Enabled || (infoTabs.SelectedTab != infotabTags && infoTabs.SelectedTab != infotabApplicability)))
{
infoTabs.Enabled = true;
infoTabs.SelectedTab = infotabTags;
infoTabs.Enabled = false;
if (infoTabs.SelectedTab != infotabApplicability)
{
infoTabs.SelectedTab = infotabTags;
}
infotabControlPanelTags.Enabled = false;
infotabControlPanelRO.Enabled = false;
infotabControlPanelTransitions.Enabled = false;
tabControlPanel1.Enabled = false;
displayApplicability.SetEnableDisableItemSelection(false);
tcpFoldoutMaint.Enabled = false;
}
else if (args.ViewMode != E_ViewMode.View && !infoTabs.Enabled)
else if (args.ViewMode != E_ViewMode.View && !infotabControlPanelTags.Enabled)
{
infoTabs.Enabled = true;
infotabControlPanelTags.Enabled = true;
infotabControlPanelRO.Enabled = true;
infotabControlPanelTransitions.Enabled = true;
tabControlPanel1.Enabled = true;
displayApplicability.SetEnableDisableItemSelection(true);
tcpFoldoutMaint.Enabled = true;
}
}
@@ -4930,9 +4990,15 @@ namespace VEPROMS
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree();
}
// B2022-026 RO Memory reduction coding (Jakes Merge)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (displayRO.LoadTree())
{
SelectedROFst = displayRO.MyROFST;
}
}
#endregion
@@ -5199,8 +5265,8 @@ namespace VEPROMS
{
if (SelectedDVI != null)
displayReports.Mydocversion = SelectedDVI;
displayReports.advTreeProcSetsFillIn(reportFocus);
displayReports.advTreeROFillIn(reportFocus);
displayReports.advTreeProcSetsFillIn();
displayReports.advTreeROFillIn();
displayReports.SelectReferencedObjectTab(); // to enable RO selection
}
}
@@ -5241,19 +5307,6 @@ namespace VEPROMS
Clipboard.SetDataObject(mydo);
}
}
private void btnFixMSWord_Click(object sender, EventArgs e)
{
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyDSOTabPanel != null)
{
string btnText = btnFixMSWord.Text;
btnFixMSWord.FixedSize = btnFixMSWord.Size;
btnFixMSWord.Text = "Processing ...";
this.Cursor = Cursors.WaitCursor;
tc.SelectedDisplayTabItem.MyDSOTabPanel.FixSymbolCharacters();
btnFixMSWord.Text = btnText;
this.Cursor = Cursors.Default;
}
}
private void epAnnotations_Resize(object sender, EventArgs e)
{
@@ -899,10 +899,10 @@ namespace VEPROMS
set
{
if (ProgressBar == null) return;
ProgressBar.Maximum = 100;
ProgressBar.Value = 100;
ProgressBar.Text = value;
Application.DoEvents();
ProgressBar.Text = value;
ProgressBar.Maximum = 100;
ProgressBar.Value = 100;
Application.DoEvents();
}
}
@@ -1527,8 +1527,11 @@ namespace VEPROMS
Cursor = Cursors.WaitCursor;
// RO changes placed in file in the Documents\VEPROMS folder
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
//must get id before ROFST gets updated so know what to refresh later
int origfstid = SelectedROFst.ROFstID;
// RO changes placed in file in the Documents\VEPROMS folder
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
DocVersion dv = _DocVersionConfig.MyDocVersion;
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
@@ -1536,13 +1539,32 @@ namespace VEPROMS
ROFstInfo.UpdateRoFst(SelectedROFst.MyRODb, dv, SelectedROFst, DoProgressBarRefresh);
SelectedROFst = null; // set to null to force getting the updated ROfst
}
else if (!dv.ROfstLastCompleted && origfstid == SelectedROFst.ROFstID)
{
//Handle issue where load failed without completing update
//previous RO FST did not load, get last loaded ID
//if none, use -1 which will check all ROs in the Working Draft
string cfg = dv.DocVersionAssociations[0].Config;
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
if (dv.DocVersionAssociations[0]?.MyROFst != null)
{
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
{
origfstid = -1;
}
}
else
{
origfstid = -1;
}
}
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(_DocVersionConfig.MyDocVersion, SelectedROFst, DoProgressBarRefresh, null);
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, SelectedROFst, origfstid, SelectedROFst.ROFstID);
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
swROUpdate.Close();
@@ -124,9 +124,26 @@ namespace VEPROMS.CSLA.Library
_Xp["ROUpdate", "LoadingFigures"] = value; // save selected value
}
}
#endregion // ROUpdate
#region ToString
public override string ToString()
[Category("RO Update")]
[DisplayName("Previous ROFSTID")]
[RefreshProperties(RefreshProperties.All)]
[Description("Previous ROFSTID")]
public string ROUpdate_PrevROFSTID
{
get
{
string s = _Xp["ROUpdate", "PrevROFSTID"];// get the saved value
return s;
}
set
{
_Xp["ROUpdate", "PrevROFSTID"] = value; // save selected value
}
}
#endregion // ROUpdate
#region ToString
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
+204 -130
View File
@@ -8,7 +8,6 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using static System.Net.Mime.MediaTypeNames;
namespace VEPROMS.CSLA.Library
@@ -61,7 +60,8 @@ namespace VEPROMS.CSLA.Library
#region Structs / Internal Classes
[Serializable]
public struct roHdr
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Keep Older Pre-existing naming conventions")]
public struct roHdr
{
public int hSize;
public int hYear;
@@ -78,7 +78,8 @@ namespace VEPROMS.CSLA.Library
};
[Serializable]
public struct rodbi
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Keep Older Pre-existing naming conventions")]
public struct rodbi
{
public int dbiID;
public int dbiType;
@@ -91,17 +92,20 @@ namespace VEPROMS.CSLA.Library
};
[Serializable]
public struct rogrp
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Keep Older Pre-existing naming conventions")]
public struct rogrp
{
public string value;
public string appid;
public int ID;
public int ParentID;
public rochild[] children;
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children;
};
[Serializable]
public struct rochild
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Keep Older Pre-existing naming conventions")]
public struct rochild
{
public int ID;
public int ParentID;
@@ -110,7 +114,8 @@ namespace VEPROMS.CSLA.Library
public string roid; // roid unique identifier
public string appid; // accessory page id - user specified unique id
public string value; // return value, can be multiple values
public rochild[] children;
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children;
};
public class RoExtension
@@ -131,7 +136,7 @@ namespace VEPROMS.CSLA.Library
private List<string> _baseAccPageKeys;
// RofstLookup/Conversion Variables
private int _rofstID;
private readonly int _rofstID;
private DocVersionInfo _myDocVersionInfo;
private int _selectedSlave;
private string _otherChild = string.Empty;
@@ -147,7 +152,7 @@ namespace VEPROMS.CSLA.Library
// B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database
private frmRofstLoadStatus _frmRofstLoadStatus = null;
private Dictionary<int, int> _dicRoCounts = null;
private bool _showLoadingStatus = true;
private readonly bool _showLoadingStatus = true;
private int _curRoCnt = 0;
private int _dbRoCnt = 0;
@@ -412,7 +417,6 @@ namespace VEPROMS.CSLA.Library
ROFSTLookup.rochild rc = RofstDataGetChildByAccPageID(_rofstID, accPageBase);
//if (rc.ID >=0 && rc.roid.Length < 16 && Regex.IsMatch(accPageKey, @".*\.[A-Z]") && rc.children != null && rc.children.Count() > 0)
if (rc.ID >= 0 && rc.roid.Length < 16 && !string.IsNullOrEmpty(accPageExt) && rc.children != null && rc.children.Count() > 0)
{
// Check if AccPageID/Key has a return value specific extension. Try to find the RoChild record with the specific return value type,
@@ -505,8 +509,6 @@ namespace VEPROMS.CSLA.Library
// B2023-037: Handle <=, >=, +-, -> and <- symbols. Convert to unicode for output, i.e. print and edit/view (when editing
// step, will show as 2 characters, not unicode, unless ro inserted when code replaced link text with unicode.
//(_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseDashGreaterLessThenForArrowsInROValue ||
// _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertGTELTEPMinROValue))
bool arrows1 = myiteminfo.ActiveFormat.PlantFormat.FormatData.SectData.UseDashGreaterLessThenForArrowsInROValue;
bool arrows2 = myiteminfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertGTELTEPMinROValue;
@@ -679,22 +681,25 @@ namespace VEPROMS.CSLA.Library
if (minutes > 0) duration = string.Format("{0} min(s) ", minutes.ToString("n0"));
if (secs < 0) secs = 0.00;
duration = duration + string.Format("{0,10:#####0.00} sec(s)", secs).Trim();
duration += string.Format("{0,10:#####0.00} sec(s)", secs).Trim();
return duration;
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
}
#endregion
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
public int GetNewerFSTID() => RofstGetLatestID(RofstID);
#endregion
#endregion
#region Private Methods
#endregion
#region (Database Calls)
#region Private Methods
private bool RofstDataExists(int rofstID)
#region (Database Calls)
private bool RofstDataExists(int rofstID)
{
int headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
@@ -888,7 +893,7 @@ namespace VEPROMS.CSLA.Library
}
}
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value)
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value, DateTime? dt = null)
{
try
{
@@ -917,7 +922,10 @@ namespace VEPROMS.CSLA.Library
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
cmd.ExecuteNonQuery();
if (dt != null)
cmd.Parameters.Add(new SqlParameter("@ModDateTime", SqlDbType.DateTime)).Value = dt;
cmd.ExecuteNonQuery();
}
}
}
@@ -1299,11 +1307,37 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
private int RofstGetLatestID(int rofstID)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cmd = cn.CreateCommand())
{
cmd.CommandTimeout = 0;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT ISNULL((SELECT TOP 1 ROFsts.ROFstID FROM ROFsts INNER JOIN ROFsts curFST ON curFST.RODbID = ROFsts.RODbID WHERE curFST.ROFstID = @FSTid order by ROFsts.DTS desc),-1)";
#region (Core/Base logic for RO Values & UnitInfo RO Values)
cmd.Parameters.Add(new SqlParameter("@FSTid", SqlDbType.Int)).Value = rofstID;
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
return (int) cmd.ExecuteScalar();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("RofstData.RofstGetLatestID", ex);
}
}
#endregion
#region (Core/Base logic for RO Values & UnitInfo RO Values)
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
{
try
{
@@ -1440,21 +1474,22 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.roHdr ConvertFst2Objects(byte[] ab)
{
ROFSTLookup.roHdr roh = new ROFSTLookup.roHdr();
ROFSTLookup.roHdr roh = new ROFSTLookup.roHdr
{
hSize = BitConverter.ToInt32(ab, 0),
hYear = BitConverter.ToInt16(ab, 4),
hMonth = ab[6],
hDay = ab[7],
hcYear = BitConverter.ToInt16(ab, 8),
hcMonth = ab[10],
hcDay = ab[11],
hcHour = ab[12],
hcMin = ab[13],
hcSec = ab[14],
hcHund = ab[15]
};
roh.hSize = BitConverter.ToInt32(ab, 0);
roh.hYear = BitConverter.ToInt16(ab, 4);
roh.hMonth = ab[6];
roh.hDay = ab[7];
roh.hcYear = BitConverter.ToInt16(ab, 8);
roh.hcMonth = ab[10];
roh.hcDay = ab[11];
roh.hcHour = ab[12];
roh.hcMin = ab[13];
roh.hcSec = ab[14];
roh.hcHund = ab[15];
int hdrOffset = BitConverter.ToInt32(ab, 16);
int hdrOffset = BitConverter.ToInt32(ab, 16);
int dbs = BitConverter.ToInt16(ab, hdrOffset + 4);
roh.myDbs = new ROFSTLookup.rodbi[dbs];
@@ -1490,12 +1525,13 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.rogrp LoadGroup(byte[] ab, int offset, int tableID)
{
ROFSTLookup.rogrp myGrp = new ROFSTLookup.rogrp();
ROFSTLookup.rogrp myGrp = new ROFSTLookup.rogrp
{
ID = BitConverter.ToInt32(ab, offset),
ParentID = BitConverter.ToInt32(ab, offset + 4)
};
myGrp.ID = BitConverter.ToInt32(ab, offset);
myGrp.ParentID = BitConverter.ToInt32(ab, offset + 4);
int numChildren = BitConverter.ToInt16(ab, offset + 8);
int numChildren = BitConverter.ToInt16(ab, offset + 8);
if (numChildren > 0)
{
@@ -1512,10 +1548,10 @@ namespace VEPROMS.CSLA.Library
int slen = StringLength(ab, myOffset + 6);
tmp.title = Encoding.Default.GetString(ab, myOffset + 6, slen);
myOffset += (7 + slen);
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
tmp.ID = tmpg.ID;
tmp.ParentID = tmpg.ParentID;
@@ -1523,8 +1559,12 @@ namespace VEPROMS.CSLA.Library
tmp.appid = tmpg.appid;
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
tmp.children = tmpg.children;
if (tmpg.ModDateTime != null)
{
tmp.ModDateTime = tmpg.ModDateTime;
}
int j;
int j;
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
{
@@ -1542,7 +1582,13 @@ namespace VEPROMS.CSLA.Library
int slen2 = StringLength(ab, offset + 13 + slen);
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
_dbRoCnt++;
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
if (myGrp.value != "" && DateTime.TryParseExact(Encoding.Default.GetString(ab, offset + 14 + slen + slen2, 14), "yyyyMMddHHmmss", null, System.Globalization.DateTimeStyles.None, out DateTime dt))
{
myGrp.ModDateTime = dt;
}
_dbRoCnt++;
}
return myGrp;
@@ -1615,7 +1661,7 @@ namespace VEPROMS.CSLA.Library
}
// Update Progress Bar Accordingly
if (_totalRoCnt > 0) _pctComplete = _pctComplete + ((Convert.ToDouble(_dbRoCnt) / Convert.ToDouble(_totalRoCnt)) * 80.0);
if (_totalRoCnt > 0) _pctComplete += ((Convert.ToDouble(_dbRoCnt) / Convert.ToDouble(_totalRoCnt)) * 80.0);
OnProgressChanged(displayText, Convert.ToInt32(_pctComplete), 100);
}
@@ -1655,7 +1701,7 @@ namespace VEPROMS.CSLA.Library
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
{
//Insert Rofst Child
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value);
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value, child.ModDateTime);
//Increment RO Count if RoChild has a return value
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
@@ -1675,15 +1721,13 @@ namespace VEPROMS.CSLA.Library
protected virtual void OnProgressChanged(string title, string displayText, int curVal = 0, int maxVal = 100)
{
// If frmRofstLoadStatus is not null then call Update Progress Method
if (_frmRofstLoadStatus != null)
_frmRofstLoadStatus.UpdateProgress(title, displayText, curVal, maxVal);
_frmRofstLoadStatus?.UpdateProgress(title, displayText, curVal, maxVal);
}
protected virtual void OnProgressChanged(string displayText, int curVal = 0, int maxVal = 100)
{
// If frmRofstLoadStatus is not null then call Update Progress Method
if (_frmRofstLoadStatus != null)
_frmRofstLoadStatus.UpdateProgress(_frmRofstLoadStatus.Title, displayText, curVal, maxVal);
_frmRofstLoadStatus?.UpdateProgress(_frmRofstLoadStatus.Title, displayText, curVal, maxVal);
}
#endregion
@@ -1694,21 +1738,22 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.roHdr ConvertToRoHdrObject(SafeDataReader dr, bool loadChildren)
{
ROFSTLookup.roHdr rh = new ROFSTLookup.roHdr();
ROFSTLookup.roHdr rh = new ROFSTLookup.roHdr
{
hSize = (int)dr.GetValue("hSize"),
hYear = (int)dr.GetValue("hYear"),
hMonth = (byte)dr.GetValue("hMonth"),
hDay = (byte)dr.GetValue("hDay"),
hcYear = (int)dr.GetValue("hcYear"),
hcMonth = (byte)dr.GetValue("hcMonth"),
hcDay = (byte)dr.GetValue("hcDay"),
hcHour = (byte)dr.GetValue("hcHour"),
hcMin = (byte)dr.GetValue("hcMin"),
hcSec = (byte)dr.GetValue("hcSec"),
hcHund = (byte)dr.GetValue("hcHund")
};
rh.hSize = (int)dr.GetValue("hSize");
rh.hYear = (int)dr.GetValue("hYear");
rh.hMonth = (byte)dr.GetValue("hMonth");
rh.hDay = (byte)dr.GetValue("hDay");
rh.hcYear = (int)dr.GetValue("hcYear");
rh.hcMonth = (byte)dr.GetValue("hcMonth");
rh.hcDay = (byte)dr.GetValue("hcDay");
rh.hcHour = (byte)dr.GetValue("hcHour");
rh.hcMin = (byte)dr.GetValue("hcMin");
rh.hcSec = (byte)dr.GetValue("hcSec");
rh.hcHund = (byte)dr.GetValue("hcHund");
if (loadChildren)
if (loadChildren)
{
rh.myDbs = RofstDataGetDatabases(_rofstID);
}
@@ -1718,17 +1763,18 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.rodbi ConvertToRodbiObject(SafeDataReader dr, bool loadChildren, bool loadAllChildren)
{
ROFSTLookup.rodbi rd = new ROFSTLookup.rodbi();
ROFSTLookup.rodbi rd = new ROFSTLookup.rodbi
{
dbiID = (int)dr.GetValue("dbiID"),
dbiType = (int)dr.GetValue("dbiType"),
dbiAW = (int)dr.GetValue("dbiAW"),
dbiAP = (string)dr.GetValue("dbiAP"),
dbiTitle = (string)dr.GetValue("dbiTitle"),
ID = (int)dr.GetValue("ID"),
ParentID = (int)dr.GetValue("ParentID")
};
rd.dbiID = (int)dr.GetValue("dbiID");
rd.dbiType = (int)dr.GetValue("dbiType");
rd.dbiAW = (int)dr.GetValue("dbiAW");
rd.dbiAP = (string)dr.GetValue("dbiAP");
rd.dbiTitle = (string)dr.GetValue("dbiTitle");
rd.ID = (int)dr.GetValue("ID");
rd.ParentID = (int)dr.GetValue("ParentID");
if (loadChildren || loadAllChildren)
if (loadChildren || loadAllChildren)
{
rd.children = RofstDataGetChildrenByID(_rofstID, rd.dbiID, rd.ID, false, loadAllChildren);
}
@@ -1738,15 +1784,16 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.rochild ConvertToRochildObject(SafeDataReader dr, bool loadChildren, bool loadAllChildren)
{
ROFSTLookup.rochild rc = new ROFSTLookup.rochild();
ROFSTLookup.rochild rc = new ROFSTLookup.rochild
{
ID = (int)dr.GetValue("ID"),
ParentID = (int)dr.GetValue("ParentID"),
type = (int)dr.GetValue("type"),
title = (string)dr.GetValue("title"),
roid = (string)dr.GetValue("roid")
};
rc.ID = (int)dr.GetValue("ID");
rc.ParentID = (int)dr.GetValue("ParentID");
rc.type = (int)dr.GetValue("type");
rc.title = (string)dr.GetValue("title");
rc.roid = (string)dr.GetValue("roid");
if (!string.IsNullOrEmpty((string)dr.GetValue("appid")))
if (!string.IsNullOrEmpty((string)dr.GetValue("appid")))
{
rc.appid = (string)dr.GetValue("AccPageID");
@@ -1766,13 +1813,14 @@ namespace VEPROMS.CSLA.Library
private ROFSTLookup.RoExtension ConvertToRoExtensionObject(SafeDataReader dr)
{
ROFSTLookup.RoExtension re = new ROFSTLookup.RoExtension();
ROFSTLookup.RoExtension re = new ROFSTLookup.RoExtension
{
Offset = (int)dr.GetValue("Offset"),
RoidExt = (string)dr.GetValue("RoidExt"),
AccPageExt = (string)dr.GetValue("AccPageExt")
};
re.Offset = (int)dr.GetValue("Offset");
re.RoidExt = (string)dr.GetValue("RoidExt");
re.AccPageExt = (string)dr.GetValue("AccPageExt");
return re;
return re;
}
#endregion
@@ -1830,7 +1878,6 @@ namespace VEPROMS.CSLA.Library
// Instead of returning the RoChildBase object with a single RoReturnVal object attached, just return the single Ro ReturnValue object.
var roRetVal = child.children.First();
//child.title = roRetVal.title;
child.appid = roRetVal.appid;
child.roid = roRetVal.roid;
child.value = roRetVal.value;
@@ -2084,44 +2131,71 @@ namespace VEPROMS.CSLA.Library
return ProcessRO(match, multiRtnVal);
}
private string ProcessMacros(string str)
{
// Takes the RO text value and sees if a macro has been used.
// If so it will perform the macro operation on the substring in the text value
// Note** Right now the only macro is @HSP(), where every space between the "(" and ")" will be replaced with a hard space
// Takes the RO text value and sees if a macro has been used.
// If so it will perform the macro operation on the substring in the text value
// Note** Right now the only macro is @HSP(), where every space between the "(" and ")" will be replaced with a hard space
private static string ProcessMacros(string str)
{
if (string.IsNullOrEmpty(str))
return str;
if (string.IsNullOrEmpty(str) || str.ToUpper().IndexOf("@HSP(") < 0)
return str;
string rtnstr = str;
int indx;
while ((indx = rtnstr.ToUpper().IndexOf("@HSP(")) > -1)
{
string resstr = rtnstr.Substring(0, indx);
int endHsp = rtnstr.IndexOf(")", indx);
string processingstr = str; //holds current string being processed
int indx; //current position of @HSP( in string
int endpos = 0; //end of last parens
//B2026 - 002 handle if parens inside a HSP
int startpos = indx + 5;
while (rtnstr.Substring(startpos, endHsp - startpos).Contains("("))
{
startpos = rtnstr.IndexOf("(", startpos + 1, endHsp - startpos) + 1;
endHsp = rtnstr.IndexOf(")", endHsp + 1);
}
StringBuilder sb = new StringBuilder();
Stack<char> endparens = new Stack<char>();
string tmpstr = rtnstr.Substring(indx + 5, endHsp - indx - 5);
while ((indx = processingstr.ToUpper().IndexOf("@HSP(")) > -1)
{
sb.Append(processingstr.Substring(0, indx)); // initial string before @HSP(
// B2017-012 Don't convert space to hard spaces for XY Plots.
if (!tmpstr.Contains("<<G")) tmpstr = tmpstr.Replace(" ", @"\u160?");
for (int i = indx + 5; i < processingstr.Length; i++)
{
char ch = processingstr[i];
resstr = resstr + tmpstr;
rtnstr = resstr + rtnstr.Substring(endHsp + 1);
}
if (ch == '(')
{
//if opening paren inside HSP add it to the stack to look for a closing parens
endparens.Push(ch);
}
else if (ch == ')' && endparens.Count > 0)
{
//if cloing parens and it matches an opening parens inside of HSP, remove a level
_ = endparens.Pop();
}
else if (ch == ')' && endparens.Count == 0)
{
//if closing parens and at same level as HSP, break out since found correct closing parens
endpos = i;
break;
}
else if (i == processingstr.Length - 1)
{
//if hit the end of the string and no matching closing parens found, take to the end of the string
endpos = processingstr.Length;
}
}
return rtnstr;
}
//Add the text inside the @HSP(...)
string tmpstr = processingstr.Substring(indx + 5, endpos - indx - 5);
// B2017-012 Don't convert space to hard spaces for XY Plots.
if (!tmpstr.Contains("<<G")) tmpstr = tmpstr.Replace(" ", @"\u160?");
sb.Append(tmpstr);
private int StringLength(byte[] ab, int offset)
//Set the processing string to after the ending parens found in case multiple @HSP
processingstr = endpos + 1 >= processingstr.Length ? "" : processingstr.Substring(endpos + 1);
}
//add text after last end parens
sb.Append(processingstr);
return sb.ToString();
}
private int StringLength(byte[] ab, int offset)
{
int i = 0;
while (ab[i + offset] != 0) i++;
@@ -2230,7 +2304,7 @@ namespace VEPROMS.CSLA.Library
{
rc.roid = FormatRoidKey(roid).Substring(0, 12);
DocVersionConfig dvc = (_myDocVersionInfo != null) ? _myDocVersionInfo.DocVersionConfig : null;
DocVersionConfig dvc = _myDocVersionInfo?.DocVersionConfig;
if (dvc != null) dvc.SelectedSlave = this.SelectedSlave;
switch (rc.roid)
@@ -2238,49 +2312,49 @@ namespace VEPROMS.CSLA.Library
case "FFFF00000001":
rc.title = "Number";
rc.appid = "U-NUMBER";
rc.value = (dvc != null) ? dvc.Unit_Number : null;
rc.value = dvc?.Unit_Number;
break;
case "FFFF00000002":
rc.title = "Other Number";
rc.appid = "U-OTHERNUMBER";
rc.value = (dvc != null) ? dvc.Other_Unit_Number : null;
rc.value = dvc?.Other_Unit_Number;
break;
case "FFFF00000003":
rc.title = "Text";
rc.appid = "U-TEXT";
rc.value = (dvc != null) ? dvc.Unit_Text : null;
rc.value = dvc?.Unit_Text;
break;
case "FFFF00000004":
rc.title = "Other Text";
rc.appid = "U-OTHERTEXT";
rc.value = (dvc != null) ? dvc.Other_Unit_Text : null;
rc.value = dvc?.Other_Unit_Text;
break;
case "FFFF00000005":
rc.title = "ID";
rc.appid = "U-ID";
rc.value = (dvc != null) ? dvc.Unit_ID : null;
rc.value = dvc?.Unit_ID;
break;
case "FFFF00000006":
rc.title = "Other ID";
rc.appid = "U-OTHERID";
rc.value = (dvc != null) ? dvc.Other_Unit_ID : null;
rc.value = dvc?.Other_Unit_ID;
break;
case "FFFF00000007":
rc.title = "Name";
rc.appid = "U-NAME";
rc.value = (dvc != null) ? dvc.Unit_Name : null;
rc.value = dvc?.Unit_Name;
break;
case "FFFF00000008":
rc.title = "Other Name";
rc.appid = "U-OTHERNAME";
rc.value = (dvc != null) ? dvc.Other_Unit_Name : null;
rc.value = dvc?.Other_Unit_Name;
break;
}
@@ -88,9 +88,9 @@ namespace VEPROMS.CSLA.Library
}
public override string ToString()
{
string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", "");
string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", "");
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-").Replace(@"\u9586?",@"\");
return string.Format("{4} item {0} by {1} on {2} @ {3}", this.ActionWhat, this.UserID, this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortDateString() : this.ActionWhen.ToShortDateString(), this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortTimeString() : this.ActionWhen.ToShortTimeString(), itemTitle);
return string.Format("{4} item {0} by {1} on {2} @ {3}", this.ActionWhat, this.UserID, this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortDateString() : this.ActionWhen.ToShortDateString(), this.ActionWhen == DateTime.MinValue ? this.DTS.ToString("HH:mm:ss") : this.ActionWhen.ToString("HH:mm:ss"), itemTitle);
//return string.Format("{0} by {1} on {2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
//return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted");
}
@@ -102,7 +102,7 @@ namespace VEPROMS.CSLA.Library
who = string.Format(" by {0}", this.UserID);
if (this.DTS != DateTime.Parse("1/1/1980"))
when = string.Format(" on {0}", this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
}
}
@@ -177,7 +177,7 @@ namespace VEPROMS.CSLA.Library
public override string ToString()
{
return string.Format("{0}{1} deleted by {2} on {3} @ {4}", this.Level == 0 ? "Previous " : this.Level == 1 ? "Next " : "", this.ItemType, this.UserID, this.DTS.ToShortDateString(), this.DTS.ToShortTimeString());
return string.Format("{0}{1} deleted by {2} on {3}", this.Level == 0 ? "Previous " : this.Level == 1 ? "Next " : "", this.ItemType, this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
// return string.Format("Deleted by {0} on {1} @ {2}", this.UserID, this.DTS.ToShortDateString(), this.DTS.ToShortTimeString());
// return string.Format("(ItemID: {4}, DeleteID: {5}, {0} by {1} on {2} Level: {3}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"), Level.ToString(), this.ItemID.ToString(), this.DeleteStatus.ToString());
// return string.Format("Level: {3}, {0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted", this.Level.ToString());
+101 -30
View File
@@ -1093,8 +1093,17 @@ namespace VEPROMS.CSLA.Library
}
}
}
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Refresh at item level
public static void RefreshReferenceObjects(ItemInfo tmp, ROFstInfo origROFst)
{
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
MyRefreshReferenceObjects(tmp, null, tmp.GetSectionInfo(), tmp.MyDocVersion, origROFst);
}
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
{
if (itemInfo.MyContent.ContentPartCount > 0)
{
@@ -1219,31 +1228,47 @@ namespace VEPROMS.CSLA.Library
return true;
}
#region Debug Code
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
public static List<ItemInfo> GetItemInfoWithChangedROs(int docversionid, int origfstid, int newfstid)
{
List<ItemInfo> lst = new List<ItemInfo>();
//private static void ShowDifference(string oldText, string newText)
//{
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// ShowText("OldText", ot);
// ShowText("NewText", nt);
//}
//private static void ShowText(string title, string newText)
//{
// StringBuilder sb = new StringBuilder();
// foreach (char c in newText)
// {
// if(c<' ' || c> '\x7F')
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
// else
// sb.Append(c);
// }
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
//}
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
{
using (ItemInfo itm = Get((int)r["ItemID"]))
{
lst.Add(itm);
}
}
#endregion // debug
return lst;
}
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
#region Debug Code
//private static void ShowDifference(string oldText, string newText)
//{
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// ShowText("OldText", ot);
// ShowText("NewText", nt);
//}
//private static void ShowText(string title, string newText)
//{
// StringBuilder sb = new StringBuilder();
// foreach (char c in newText)
// {
// if(c<' ' || c> '\x7F')
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
// else
// sb.Append(c);
// }
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
//}
#endregion // debug
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{
if (itemInfo.MyContent.ContentPartCount > 0)
{
@@ -1890,10 +1915,44 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo itemInfo in partInfo.MyItems)
itemInfo.SpinThroughChildren();
}
#endregion
#region LoadAtOnce
// Method to Get Item and children
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
private static DataTable Data_GetItemsWithChangedROs(int docversionid, int origfstid, int newfstid)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getItemsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", docversionid);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.CommandTimeout = Database.DefaultTimeout;
using (SqlDataAdapter da = new SqlDataAdapter(cm))
{
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
}
}
catch (Exception ex)
{
Database.LogException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
throw new DbCslaException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
}
}
#endregion
#region LoadAtOnce
// Method to Get Item and children
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
{
try
{
@@ -4054,7 +4113,10 @@ namespace VEPROMS.CSLA.Library
// date). Print_ViewableAfterChangeBarDate was created to get only that user specified date, if it exists. If it does exist, we compare
// that with the Content datetime, otherwise we proceed as before.
DateTime? viewableStartingDateTime = (MyProcedure.MyConfig as ProcedureConfig).Print_ViewableStartingChangeBarDate;
if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate)
// B2026-060 & B2026-061 removed the check of SelectedSlave (aka the selected child) from the IF statement,
// This was causing some step to print with change bars when there should not have been - because of the use of
// the Show Change Bars After date. The logic we need is built into the get of ChangeBarDate and Print_ViewableStartingChangeBarDate.
if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate)
return (MyContent.DTS > viewableStartingDateTime);
return (MyContent.DTS > MyProcedure.ChangeBarDate);
}
@@ -6215,8 +6277,13 @@ namespace VEPROMS.CSLA.Library
if (!SectionHasCheckOffs()) return null;
int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined
if (stpCoIndx == -1) return null;
//B2026-040 - Signoff/Checkoffs not printing unless set to Section Default
if (stpCoIndx > 1)
{
return ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList[stpCoIndx]; // DO override of CheckOffList[]
}
int sectCoIndx = SectionDefaultCheckOffIndex(); // no checkoff on step, see if there is a section default.
int sectCoIndx = SectionDefaultCheckOffIndex(); // no checkoff on step, see if there is a section default.
if (sectCoIndx == -1) return null;
if ((ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffOnHLSOnly && IsHigh)
|| (!ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffOnHLSOnly && IsLowestLevelStep && stpCheckOff)) // && !RNOsHighHasCheckOff()))
@@ -8059,6 +8126,10 @@ namespace VEPROMS.CSLA.Library
}
set { _ChangeBarDate = value; }
}
//C2026-021 Expand Functionality of Viewing Mode
public void ResetChangeBar() => _ChangeBarDate = null;
public Dictionary<int, ItemInfo> MyLookup = null;
public override void SetupTags()
{
+40 -50
View File
@@ -61,57 +61,47 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
}
}
// used to remove word section PDFs to force ROs to be updated when printed or saved
public static void DeleteAllDocVersion(int versionID)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DataPortal.Delete(new VersionIDCriteria(versionID));
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
[Serializable()]
protected class VersionIDCriteria
{
private int _VersionID;
public int VersionID
{ get { return _VersionID; } }
public VersionIDCriteria(int versionID)
{
_VersionID = versionID;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private void DataPortal_Delete(VersionIDCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Pdf.DataPortal_Delete", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAllDocVersionPdfs";
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
}
}
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// used to remove word section PDFs to force ROs to be updated when printed or saved
public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DeleteWithNewROs(versionID, origfstid, newfstid);
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteDocVersionPdfsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", docversionID);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
}
}
}
public partial class PdfInfo
{
+80 -246
View File
@@ -225,41 +225,62 @@ namespace VEPROMS.CSLA.Library
}
}
// B2022-026 RO Memory Reduction code - pass in the ROFstInfo
public static int RefreshROFst(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo origROFst)
{
int fixedROs = 0;
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// Refresh at item level
public static int RefreshROFstAtItemLevel(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo localROFst, int origfstid, int newfstid)
{
int fixedROs = 0;
if (dvi.DocVersionConfig.SelectedSlave <= 0)
{
myProgressBarRefresh(1, 100, "Update MS Word ROs");
if (dvi.DocVersionConfig.SelectedSlave <= 0)
{
// remove word section PDFs to force update of RO values when printed
myProgressBarRefresh(1, 100, "Updating MS Word ROs In Progress");
Pdf.DeleteDocVersionPDFsWithNewROs(dvi.VersionID, origfstid, newfstid);
Pdf.DeleteAllDocVersion(dvi.VersionID); // remove word section PDFs to force update of RO values when printed
int i = 0;
//Loop Through ROs in this docversion that are different than the previous fst
myProgressBarRefresh(50, 100, "Updating ROs In PROMS Steps In Progress");
int i = 0;
List<ItemInfo> list = ItemInfo.GetItemInfoWithChangedROs(dvi.VersionID, origfstid, newfstid);
foreach (ItemInfo itm in list)
{
DateTime start = DateTime.Now;
foreach (ProcedureInfo proc in dvi.Procedures)
{
DateTime start = DateTime.Now;
ItemInfo.ResetROCounters();
myProgressBarRefresh(++i, list.Count, string.Format("{0} ({1}/{2} ROs {3})", itm.MyProcedure.DisplayNumber, i, list.Count, fixedROs));
ItemInfo.RefreshReferenceObjects(itm, localROFst);
fixedROs += ItemInfo.ROFixCount;
ProcedureInfo.ResetROCounters();
myProgressBarRefresh(++i, dvi.Procedures.Count, string.Format("{0} ({1}/{2} ROs {3})", proc.DisplayNumber, i, dvi.Procedures.Count, fixedROs));
ProcedureInfo.RefreshReferenceObjects(proc, origROFst);
fixedROs += ProcedureInfo.ROFixCount;
TimeSpan ts = DateTime.Now - start;
TimeSpan ts = DateTime.Now - start;
if (tbStatus != null)
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
}
if (tbStatus != null)
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.ROCheckCount, ProcedureInfo.ROFixCount, ts.TotalSeconds));
}
}
//Update the DocVersion Associations to link to the new RO FST id and current date/time
using (DocVersion dv = DocVersion.Get(dvi.VersionID))
{
if (dvi.DocVersionAssociations[0].MyROFst.ROFstID != newfstid)
{
dv.DocVersionAssociations[0].MyROFst = localROFst.GetJustROFst();
SetAssociationLastCompleted(dv, DateTime.Now.ToString());
}
}
}
return fixedROs;
}
// pop up a message window telling the user the RO Update has completed and how many ROs were updated
// If we are updating RO from the Admin Tools (from the V button) and we are updating more than on procedure set, then just append the "RO Update Complete" text
// To the MessageList. Once completed will all procedure sets, Admin Tools will display one message box with all the results in it.
if (MessageList == null)
FlexibleMessageBox.Show(fixedROs == 0 ? "No ROs Required Updating" : string.Format("{0} ROs Updated for {1}", fixedROs, dvi.MyFolder.Name), "RO Update Complete");
else
MessageList.AppendLine((fixedROs == 0 ? "No ROs Required Updating for " : string.Format("{0} ROs Updated for ", fixedROs)) + dvi.MyFolder.Name);
return fixedROs;
}
//C2022-028 for Admin tool to check for bad RO links
//B2022-144 we now loop through checked procedures list from Admin Tools and call this method for each procedure we want to process
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
//C2022-028 for Admin tool to check for bad RO links
//B2022-144 we now loop through checked procedures list from Admin Tools and call this method for each procedure we want to process
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
{
int FoundBadROLinks = 0;
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
@@ -291,34 +312,6 @@ namespace VEPROMS.CSLA.Library
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\ROUpdateReport_" + ValidFileName.FixFileName(dvi.MyFolder.Name.Replace(" ", "_") + "_" + DateTime.Now.ToString("MM-dd-yyyy_HH-mm-ss") + ".txt");
}
// B2022-026 RO Memory Reduction code - moved the call to UpdateROFst() to before we call RefreshROFst
// so that we used the correct ROFstInfo which as the needed event methods set when updated RO Table types
public static ROFst RefreshROFst(DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus)
{
ROFst rofst = null;
rofst = docver.DocVersionAssociations[0].MyROFst;
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
SetAssociationLastCompleted(docver, string.Empty);
int fixedROs = RefreshROFst(dvi, myProgressBarRefresh, tbStatus, origROFst);
SetAssociationLastCompleted(docver, DateTime.Now.ToString()); // RO Update completed successfully and un-interrupted, save the date/time to the Doc Version Association config
myProgressBarRefresh(100, 100, "RO Update Complete"); // update the progress bar
System.Windows.Forms.Application.DoEvents();
// pop up a message window telling the user the RO Update has completed and how many ROs were updated
// If we are updating RO from the Admin Tools (from the V button) and we are updating more than on procedure set, then just append the "RO Update Complete" text
// To the MessageList. Once completed will all procedure sets, Admin Tools will display one message box with all the results in it.
if (MessageList == null)
FlexibleMessageBox.Show(fixedROs == 0 ? "No ROs Required Updating" : string.Format("{0} ROs Updated for {1}", fixedROs, dvi.MyFolder.Name), "RO Update Complete");
else
MessageList.AppendLine((fixedROs == 0 ? "No ROs Required Updating for " : string.Format("{0} ROs Updated for ", fixedROs)) + dvi.MyFolder.Name);
return rofst;
}
/// <summary>
/// Updates an ro.fst into a sql database.
/// </summary>
@@ -333,9 +326,13 @@ namespace VEPROMS.CSLA.Library
// all of the calls aways set the flags to not update the RO values
public static ROFst UpdateRoFst(RODbInfo rdi, DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update");
ROWorkingDraftAsk.ClearWorkingDrafts();
DirectoryInfo di = new DirectoryInfo(rdi.FolderPath);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update");
int origFSTid = origROFst.ROFstID;
DirectoryInfo di = new DirectoryInfo(rdi.FolderPath);
string rofstfilepath = rdi.FolderPath + @"\ro.fst";
FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
FileInfo rofstFI = new FileInfo(rofstfilepath);
@@ -361,8 +358,9 @@ namespace VEPROMS.CSLA.Library
docver.DocVersionAssociations[0].MyROFst = rofst;
SetAssociationLastCompleted(docver, string.Empty);
SetPrevFSTID(docver, origFSTid); // //C2026-008 Re-Architect RO.FST to include RO Modification date/time
return rofst;
return rofst;
}
// Read in the rofst & make the rofst record.
@@ -384,7 +382,10 @@ namespace VEPROMS.CSLA.Library
// Keep a list of ROIDs for Images that have changed.
List<string> MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, rodb, myLookup, docver);
return rofst;
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
SetPrevFSTID(docver, origFSTid);
return rofst;
}
}
@@ -484,8 +485,22 @@ namespace VEPROMS.CSLA.Library
docver.Save();
}
// Place the status of loading the RO Figures when updating RO Values
private static void SetAssociationROFiguresLoading(DocVersion docver, string value)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// Place the previous ROFSTID in the config in case network error or computer crashes while updating RO Values
private static void SetPrevFSTID(DocVersion docver, int value)
{
if (docver.DocVersionAssociations[0]?.MyROFst != null && value != -1)
{
string cfg = docver.DocVersionAssociations[0].Config;
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
ac.ROUpdate_PrevROFSTID = value.ToString();
docver.DocVersionAssociations[0].Config = ac.ToString();
docver.Save();
}
}
// Place the status of loading the RO Figures when updating RO Values
private static void SetAssociationROFiguresLoading(DocVersion docver, string value)
{
string cfg = docver.DocVersionAssociations[0].Config;
@@ -670,188 +685,7 @@ namespace VEPROMS.CSLA.Library
return sb.ToString();
}
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst, DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, List<string> MyChangedFigureROIDs)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Update Ro Values");
string versionList = dvi.VersionID.ToString();
ROFSTLookup origLookup = new ROFSTLookup(origROFstInfo.ROFstID, dvi);
ROFSTLookup newLookup = new ROFSTLookup(newROFst.ROFstID, dvi);
List<string> delList = new List<string>();
List<string> chgList = newLookup.GetValueDifferences(origROFstInfo.ROFstID, ref delList);
// Any figures which have been changed will be included in the list of values that have changed.
if (MyChangedFigureROIDs != null)
{
foreach (string roid in MyChangedFigureROIDs)
{
if (!chgList.Contains(roid)) chgList.Add(roid);
}
}
string RoidList = GetRoidList(newROFst.RODbID, chgList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
List<string> activeRoids = BuildActiveROIDsForRoUsages12(RoidList, versionList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Updating RO Values");
int iCount = 0;
if (activeRoids.Count > 0)
{
foreach (string chg in chgList)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the RoUsages table. They may be stored as 12 characters in the ro.fst.
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
// B2022-088: Find Doc Ro button not working in Word Sections
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
{
foreach (RoUsageInfo roUsg in affected)
{
using (Content content = Content.Get(roUsg.MyContent.ContentID))
{
foreach (ItemInfo ii in roUsg.MyContent.ContentItems)
{
string val = newLookup.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, ii.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, ii);
content.FixContentText(roUsg, val, roch.type, origROFstInfo, true);
if (content.IsDirty)
{
// Update UserID and DTS when RO Value is updated.
content.UserID = Volian.Base.Library.VlnSettings.UserID;
content.DTS = DateTime.Now;
content.Save();
if (content.MyGrid != null)
{
GridInfo.Refresh(content.MyGrid);
}
}
}
}
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
List<string> activeDRoids = BuildActiveROIDsForDRoUsages12(RoidList, versionList);
iCount = 0;
if (activeDRoids.Count > 0)
{
foreach (string chg in chgList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeDRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the rousages table. They may be stored as 12 characters in the ro.fst.
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
{
foreach (DROUsageInfo droUsg in affected)
{
Pdf.DeleteAll(droUsg.DocID);
}
}
}
}
}
iCount = 0;
string RoidDelList = GetRoidList(newROFst.RODbID, delList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
activeRoids = BuildActiveROIDsForRoUsages12(RoidDelList, versionList);
if (activeRoids.Count > 0)
{
foreach (string del in delList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
//string padroiddel = del.Length <= 12 ? del + "0000" : del;
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
if (activeRoids.Contains(del.Substring(0, 12).ToUpper()))
{
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
{
foreach (RoUsageInfo roUsg in affected)
{
using (Content content = Content.Get(roUsg.MyContent.ContentID))
{
content.FixContentText(roUsg, "?", 0, origROFstInfo);
if (content.IsDirty)
{
// Update UserID and DTS when RO Value is updated.
content.UserID = Volian.Base.Library.VlnSettings.UserID;
content.DTS = DateTime.Now;
content.Save();
}
}
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
activeDRoids = BuildActiveROIDsForDRoUsages12(RoidDelList, versionList);
iCount = 0;
if (activeDRoids.Count > 0)
{
foreach (string del in delList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
// If there's an issue then maybe try getting the RoChild with the Padded roid instead
//string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(padroiddel).value);
if (activeDRoids.Contains(del.Substring(0, 12).ToUpper()))
{
using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
{
foreach (DROUsageInfo droUsg in Daffected)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
Pdf.DeleteAll(droUsg.DocID);
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(100, 100, "RO Values Updated");
}
private static DateTime ShowDuration(DateTime dtLast, string message)
private static DateTime ShowDuration(DateTime dtLast, string message)
{
DateTime dtNext = DateTime.Now;
Console.WriteLine("{0,10:#####0.00},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - dtLast.Ticks).TotalSeconds, message);
@@ -1099,10 +933,10 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
}
#endregion
}
public class ROFstInfoROTableUpdateEventArgs
public class ROFstInfoROTableUpdateEventArgs
{
private string _ROText;
public string ROText
@@ -1252,5 +1086,5 @@ namespace VEPROMS.CSLA.Library
this.RaiseListChangedEvents = true;
}
}
}
}
@@ -0,0 +1,18 @@

using System.Collections.Generic;
namespace VEPROMS.CSLA.Library
{
public static class ROWorkingDraftAsk
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private static List<int> WorkingDrafts = new List<int>();
public static void AddWorkingDrafts(int wd) => WorkingDrafts.Add(wd);
public static void ClearWorkingDrafts() => WorkingDrafts.Clear();
public static bool ContainsWorkingDraft(int wd) => WorkingDrafts.Contains(wd);
}
}
@@ -396,6 +396,7 @@
<Compile Include="Minimal\UserReports.cs" />
<Compile Include="Minimal\UserSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Session\ROWorkingDraftAsk.cs" />
<Compile Include="VEObjects\VEDrillDown.cs" />
<Compile Include="VEObjects\VETreeNode.cs" />
</ItemGroup>
@@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volian.Controls.Library
{
class AlphabeticalNumbering
{
//private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static string Letter(int number)
{
char c = (char)(number + 64);
return c.ToString();
}
public static string Convert(int number)
{
string retval=string.Empty;
if (number > 26) retval += Letter((number-1) / 26);
retval += Letter(1 + ((number-1) % 26));
return retval;
}
//private static int[] _TestLetters = new int[] {
// 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
// 52,53,78,79,104,105
// };
//public static void ShowLetters()
//{
// for (int i = 0; i < _TestLetters.Length; i++)
// {
// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", _TestLetters[i], Convert(_TestLetters[i]));
// }
//}
}
}
@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using Volian.Pipe.Library;
using System.Xml;
using System.Diagnostics;
using JR.Utils.GUI.Forms;
using System;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml;
using VEPROMS.CSLA.Library;
using Volian.Pipe.Library;
namespace Volian.Controls.Library
{
@@ -63,14 +59,14 @@ namespace Volian.Controls.Library
AddAttribute(xe, "Text", myItemInfo.DisplayText);
_ProcList.DocumentElement.AppendChild(xe);
if (myItemInfo.Cautions != null) foreach (StepInfo caui in myItemInfo.Cautions) AddItem(myItemInfo.ItemID, caui);
if (myItemInfo.Notes != null) foreach (StepInfo noti in myItemInfo.Notes) AddItem(myItemInfo.ItemID, noti);
if (myItemInfo.RNOs != null) foreach (StepInfo rnoi in myItemInfo.RNOs) AddItem(myItemInfo.ItemID, rnoi);
if (myItemInfo.Sections != null) foreach (SectionInfo seci in myItemInfo.Sections) AddItem(myItemInfo.ItemID, seci);
if (myItemInfo.Cautions != null) foreach (StepInfo caui in myItemInfo.Cautions.OfType<StepInfo>()) AddItem(myItemInfo.ItemID, caui);
if (myItemInfo.Notes != null) foreach (StepInfo noti in myItemInfo.Notes.OfType<StepInfo>()) AddItem(myItemInfo.ItemID, noti);
if (myItemInfo.RNOs != null) foreach (StepInfo rnoi in myItemInfo.RNOs.OfType<StepInfo>()) AddItem(myItemInfo.ItemID, rnoi);
if (myItemInfo.Sections != null) foreach (SectionInfo seci in myItemInfo.Sections.OfType<SectionInfo>()) AddItem(myItemInfo.ItemID, seci);
if (myItemInfo.Steps != null)
{
if(myItemInfo.IsSection || (myItemInfo.IsHigh && SubStepHasRNOs(myItemInfo.Steps)))
foreach (StepInfo stpi in myItemInfo.Steps) AddItem(myItemInfo.ItemID, stpi);
foreach (StepInfo stpi in myItemInfo.Steps.OfType<StepInfo>()) AddItem(myItemInfo.ItemID, stpi);
}
}
}
@@ -101,7 +97,6 @@ namespace Volian.Controls.Library
{
_CurrentItem = value;
SetupCurrentItemValues();
SetupConfigEdit();
// B2017-126 Only turn-on NamedPipe if Command Line parameter /NamedPipe is used.
// This eliminates waiting for the Pipe if the command line parameter is not used.
if (ExeType > 0 && Volian.Base.Library.VlnSettings.GetCommandFlag("NamedPipe")) SendPromsAnnotationData();
@@ -129,10 +124,7 @@ namespace Volian.Controls.Library
if (ai.TypeID == ExeType) return ai;
return null;
}
private void SetupConfigEdit()
{
//if (ExeType == 0) ; // initialize ExeType
}
private string _ExePath;
private string _PipeOut;
private string _PipeIn;
@@ -220,7 +212,10 @@ namespace Volian.Controls.Library
{
if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface
{
rtxbComment.Text = value;
if (value != null)
{
rtxbComment.Text = Regex.Replace(value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString());
}
if (rtxbComment.Text != string.Empty)
rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text
}
@@ -252,9 +247,6 @@ namespace Volian.Controls.Library
public AnnotationDetails()
{
InitializeComponent();
//#if(DEBUG)
//Resize+=new EventHandler(AnnotationDetails_Resize); // Debug the resize event
//#endif
Resize += AnnotationDetails_Resize;
}
@@ -280,17 +272,12 @@ namespace Volian.Controls.Library
// CSM B2024-068 / B2024-069 - check if current annotation is not selected before removal of annotation
if (CurrentAnnotation != null)
{
//using (Annotation annotation = CurrentAnnotation.Get())
//{
// annotation.Delete();
_AnnotationSearch.LoadingList = true;
Annotation.DeleteAnnotation(CurrentAnnotation);
// annotation.Save();
_AnnotationSearch.LoadingList = false;
CurrentAnnotation = null;
UpdateAnnotationGrid();
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
//}
}
else
{
@@ -421,14 +408,6 @@ namespace Volian.Controls.Library
}
}
private void CheckClientProcess()
{
if (ClientProcess.HasExited)
{
ClientProcess = null;
StartClientProcess();
}
}
void ClientProcess_Exited(object sender, EventArgs e)
{
ClientProcess = null;
@@ -473,7 +452,6 @@ namespace Volian.Controls.Library
{
XmlDocument xdConfig = new XmlDocument();
xdConfig.LoadXml(ai.Config);
ProcedureInfo currentProc = CurrentItem.MyProcedure;
XmlNode nd = xdMessage.DocumentElement.SelectSingleNode("//PromsAnnotationConfig");
nd.AppendChild(xdMessage.ImportNode(xdConfig.DocumentElement, true));
}
@@ -591,7 +569,7 @@ namespace Volian.Controls.Library
}
private XmlNode GetNode(XmlDocument xd, string nodeName)
{
return xd.DocumentElement.SelectSingleNode("//" + nodeName);
return xd.DocumentElement.SelectSingleNode($"//{nodeName}");
}
private string GetAttribute(XmlDocument xd, string nodeName, string attrName)
{
@@ -666,8 +644,8 @@ namespace Volian.Controls.Library
if (!_LoadingGrid && (dgAnnotations.FirstDisplayedScrollingRowIndex != -1))
dgAnnotations.FirstDisplayedScrollingRowIndex = row;
}
catch (Exception ex)
{
catch (Exception)
{
_MyLog.InfoFormat("Trying to open an annotation which has been removed");
}
}
@@ -688,8 +666,6 @@ namespace Volian.Controls.Library
using (Annotation annotation = Annotation.MakeAnnotation(myItem, annotationType, rtxbComment.Rtf, rtxbComment.Text, ""))
{
CurrentAnnotation = AnnotationInfo.Get(annotation.AnnotationID);
//annotation.DTS = DateTime.Now;
//annotation.Save();
}
}
}
@@ -720,7 +696,7 @@ namespace Volian.Controls.Library
private void btnEPAnnotation_Click(object sender, EventArgs e)
{
frmEPAnnotationDetails EPfrm = new frmEPAnnotationDetails(CurrentAnnotation);
DialogResult dr = EPfrm.ShowDialog(this);
}
_ = EPfrm.ShowDialog(this);
}
}
}
+15 -43
View File
@@ -1,8 +1,5 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
@@ -10,19 +7,11 @@ namespace Volian.Controls.Library
{
public partial class BorderListBox : ListBox
{
#region Properties
public GridLinePattern SelectedLinePattern
{
get { return (Items[SelectedIndex] as GridLBItem).LinePattern; }
}
#endregion
#region ctor
public BorderListBox()
{
InitializeComponent();
SetupOptions();
}
public BorderListBox(IContainer container)
#region Properties
public GridLinePattern SelectedLinePattern => (Items[SelectedIndex] as GridLBItem).LinePattern;
#endregion
#region ctor
public BorderListBox(IContainer container)
{
container.Add(this);
InitializeComponent();
@@ -31,9 +20,7 @@ namespace Volian.Controls.Library
private void SetupOptions()
{
this.DrawMode = DrawMode.OwnerDrawFixed;
//this.Font.Size;
DrawItem += new DrawItemEventHandler(BorderListBox_DrawItem);
//MeasureItem += new MeasureItemEventHandler(BorderListBox_MeasureItem);
Items.Add(new GridLBItem(GridLinePattern.None));
Items.Add(new GridLBItem(GridLinePattern.Single));
Items.Add(new GridLBItem(GridLinePattern.Double));
@@ -55,10 +42,6 @@ namespace Volian.Controls.Library
}
#endregion
#region Event Handlers
//void BorderListBox_MeasureItem(object sender, MeasureItemEventArgs e)
//{
// e.ItemHeight = 22;
//}
private int _MaxLabelWidth = 0;
private int MaxLabelWidth(Graphics gr)
{
@@ -102,25 +85,14 @@ namespace Volian.Controls.Library
}
public class GridLBItem
{
#region Properties
private GridLinePattern _LinePattern;
public GridLinePattern LinePattern
{
get { return _LinePattern; }
set { _LinePattern = value; }
}
#endregion
#region ctor
public GridLBItem(GridLinePattern linePattern)
{
LinePattern = linePattern;
}
#endregion
#region Public Methods
public override string ToString()
{
return LinePattern.ToString();
}
#endregion
}
#region Properties
public GridLinePattern LinePattern { get; set; }
#endregion
#region ctor
public GridLBItem(GridLinePattern linePattern) => LinePattern = linePattern;
#endregion
#region Public Methods
public override string ToString() => LinePattern.ToString();
#endregion
}
}
@@ -1,8 +1,5 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using C1.Win.C1FlexGrid;
@@ -16,8 +13,8 @@ namespace Volian.Controls.Library
public event BorderSelectionPanelEvent BordersChanged;
private void OnBordersChanged(object sender, EventArgs args)
{
if (BordersChanged != null) BordersChanged(sender, args);
}
BordersChanged?.Invoke(sender, args);
}
#endregion
#region Properties
private bool _HasRows = true;
@@ -155,8 +152,6 @@ namespace Volian.Controls.Library
}
public void InitializeBorder(VlnFlexGrid myFlexGrid, CellRange myRange)
{
//if (myRange.r1 == 0 && myRange.c1 == 0 && myRange.r2 == 2 && myRange.c2 == 2)
//Console.WriteLine("here");
_TopBorder = GridLinePattern.Unknown;
_InsideHorizontalBorder = GridLinePattern.Unknown;
_BottomBorder = GridLinePattern.Unknown;
@@ -249,18 +244,11 @@ namespace Volian.Controls.Library
DrawBackground(e, x1, y1, x2, y2, w1, h1, w2, h2, offset, HasRows, HasColumns);
DrawBorder(e, x1, y1, x2, y2);
}
private static void DrawBackground(PaintEventArgs e, int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int offset,bool hasRows, bool hasColumns)
{
#pragma warning disable IDE0060 // Remove unused parameter
private static void DrawBackground(PaintEventArgs e, int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int offset,bool hasRows, bool hasColumns)
#pragma warning restore IDE0060 // Remove unused parameter
{
e.Graphics.FillRectangle(Brushes.White, offset, offset, w2 - 2* offset, h2 - 2* offset);
// Old Backgound - Shows corners
//e.Graphics.DrawLine(Pens.LightBlue, x1, offset, x1, y1);
//e.Graphics.DrawLine(Pens.LightBlue, x2, offset, x2, y1);
//e.Graphics.DrawLine(Pens.LightBlue, x1, y2, x1, h2 - offset);
//e.Graphics.DrawLine(Pens.LightBlue, x2, y2, x2, h2 - offset);
//e.Graphics.DrawLine(Pens.LightBlue, offset, y1, x1, y1);
//e.Graphics.DrawLine(Pens.LightBlue, x2, y1, w2 - offset, y1);
//e.Graphics.DrawLine(Pens.LightBlue, offset, y2, x1, y2);
//e.Graphics.DrawLine(Pens.LightBlue, x2, y2, w2 - offset, y2);
// Horizontal Lines
e.Graphics.DrawLine(Pens.LightBlue, offset, y1, w2 - offset, y1);
if (hasRows) e.Graphics.DrawLine(Pens.LightBlue, x1 + offset, (y1 + y2) / 2, x2 - offset , (y1 + y2) / 2);
@@ -287,8 +275,8 @@ namespace Volian.Controls.Library
if (LineWidth(linePattern) == 3)
{
dxo2 = dxo1 = -1;
dyi2 = dyo1 = LineWidth(startPattern) == 3 ? -1 : 0;
dyi1 =dyo2 = LineWidth(endPattern) == 3 ? 1 : 0;
dyo1 = LineWidth(startPattern) == 3 ? -1 : 0;
dyo2 = LineWidth(endPattern) == 3 ? 1 : 0;
dxi1 = -dxo1; dxi2 = -dxo2; dyi1 = -dyo1; dyi2 = -dyo2;
if (linePattern == GridLinePattern.Thick) dyo2++; // Fix for bug in Graphics. Seems to happen when line is thick.
}
@@ -303,8 +291,8 @@ namespace Volian.Controls.Library
if (LineWidth(linePattern) == 3)
{
dyo2 = dyo1 = 1;
dxi2 = dxo1 = LineWidth(startPattern) == 3 ? -1 : 0;
dxi1 = dxo2 = LineWidth(endPattern) == 3 ? 1 : 0;
dxo1 = LineWidth(startPattern) == 3 ? -1 : 0;
dxo2 = LineWidth(endPattern) == 3 ? 1 : 0;
dxi1 = -dxo1;dxi2 = -dxo2;dyi1 = -dyo1;dyi2 = -dyo2;
if (linePattern == GridLinePattern.Thick) dxo2++; // Fix for bug in Graphics. Seems to happen when line is thick.
}
@@ -347,7 +335,7 @@ namespace Volian.Controls.Library
{
if (linePattern == GridLinePattern.None) return;
int dyi1 = 0; int dyi2 = 0; int dxi1 = 0; int dxi2 = 0;
int dyo1 = 0; int dyo2 = 0; int dxo1 = 0; int dxo2 = 0;
int dyo1; int dyo2; int dxo1 = 0; int dxo2 = 0;
if (LineWidth(linePattern) == 3)
{
dxo2 = dxo1 = 1;
@@ -368,7 +356,7 @@ namespace Volian.Controls.Library
{
if (linePattern == GridLinePattern.None) return;
int dyi1 = 0; int dyi2 = 0; int dxi1 = 0; int dxi2 = 0;
int dyo1 = 0; int dyo2 = 0; int dxo1 = 0; int dxo2 = 0;
int dyo1 = 0; int dyo2 = 0; int dxo1; int dxo2;
if (LineWidth(linePattern) == 3)
{
dyo2 = dyo1 = -1;
+18 -58
View File
@@ -1,33 +1,24 @@
using C1.Win.C1FlexGrid;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
namespace Volian.Controls.Library
{
public partial class frmImportWordContents : Form
{
private static string GetTableText()
{
return TblFlexGrid.GetSearchableText();
}
private static VlnFlexGrid _TblFlexGrid = null;
{
private static VlnFlexGrid _TblFlexGrid = null;
public static VlnFlexGrid TblFlexGrid
{
get {
if (_TblFlexGrid == null) _TblFlexGrid = new VlnFlexGrid();
return frmImportWordContents._TblFlexGrid;
return _TblFlexGrid;
}
set { frmImportWordContents._TblFlexGrid = value; }
set { _TblFlexGrid = value; }
}
private static void LoadTable2(XmlNode xn)
@@ -54,15 +45,7 @@ namespace Volian.Controls.Library
fg.BringToFront();
fg.Invalidate();
Application.DoEvents();
//ShowColumnWidths(fg);
fg.MakeRTFcells(false);
//ShowMergedCells(fg);
//ShowColumnWidths(fg);
//Well, Can I save the table
//using (Step step = MakeCSLAStep(mySteps, mySteps.Count, null, {TableContent}, 20008, E_FromType.Table))
//{
// Grid.MakeGrid(step.MyContent, fg.GetXMLData(), "");
//}
}
public static VlnFlexGrid _MyFlexGrid = null;
private static void AddTableRow(XmlNode xr, VlnFlexGrid fg, int rows)
@@ -73,14 +56,7 @@ namespace Volian.Controls.Library
foreach (XmlNode xc in xr.ChildNodes)
{
++cols;
//if (xc.InnerText.Contains("RC-V200"))
// Console.WriteLine(xc.InnerText);
//if (xc.InnerText.Contains("RC-V121"))
// Console.WriteLine(xc.InnerText);
//if (xc.InnerXml.Contains("AB 137") || xc.InnerXml.Contains("3013N01"))
// Console.WriteLine("here");
CellRange cr2 = GetMyMergedRange(fg, rows - 1, cols - 1);
//Console.WriteLine("Check {0}", cr2);
while (cr2.c1 != cols - 1 || cr2.r1 != rows - 1)
{
cols++;
@@ -123,7 +99,6 @@ namespace Volian.Controls.Library
break;
}
}
//ShowMergedCells(fg);
if (xc.Name == "td")
{
AddTableColumn(xc, fg, rows, cols);
@@ -131,26 +106,9 @@ namespace Volian.Controls.Library
}
}
//private static void ShowColumnWidths(VlnFlexGrid fg)
//{
// foreach (Column c in fg.Cols)
// Console.WriteLine("Width[{0}]={1}", c.Index, c.Width);
//}
private static void ShowMergedCells(VlnFlexGrid fg)
private static int GetSpan(string span)
{
for (int r = 0; r < fg.Rows.Count; r++)
{
for (int c = 0; c < fg.Cols.Count; c++)
{
CellRange cr3 = GetMyMergedRange(fg, r, c);
if (fg.MergedRanges.Contains(cr3))
Console.WriteLine("cr3 r={0},c={1},rng={2}", r, c, cr3);
}
}
}
private static int GetSpan(string span)
{
int retval = int.Parse("0" + (span ?? ""));
int retval = int.Parse($"0{span ?? ""}");
if (retval == 0) return 0;
return retval - 1;
}
@@ -175,12 +133,14 @@ namespace Volian.Controls.Library
if (r2 > fg.Rows.Count) fg.Rows.Count = r2;
int c2 = c1 + GetSpan(colspan);
if (c2 > fg.Cols.Count) fg.Cols.Count = c2;
CellRange cr = new CellRange();
cr.r1 = r1 - 1;
cr.r2 = r2 - 1;
cr.c1 = c1 - 1;
cr.c2 = c2 - 1;
fg.MergedRanges.Add(cr);
CellRange cr = new CellRange
{
r1 = r1 - 1,
r2 = r2 - 1,
c1 = c1 - 1,
c2 = c2 - 1
};
fg.MergedRanges.Add(cr);
//Console.WriteLine("Merged {0}", cr);
}
}
@@ -194,7 +154,7 @@ namespace Volian.Controls.Library
}
return fg.GetMergedRange(r, c);
}
private static Regex regNumber = new Regex("^[0-9]+$", RegexOptions.Compiled);
private static readonly Regex regNumber = new Regex("^[0-9]+$", RegexOptions.Compiled);
private static void AddTableColumn(XmlNode xc, VlnFlexGrid fg, int rows, int cols)
{
//Console.WriteLine("Rows {0}, Cols {1}", rows, cols);
@@ -218,7 +178,7 @@ namespace Volian.Controls.Library
{
if (xn.Name == "p")
{
sb.Append(prefix + xn.InnerText);
sb.Append($"{prefix}{xn.InnerText}");
}
if (xn.Name == "ul")
{
@@ -226,11 +186,11 @@ namespace Volian.Controls.Library
{
if (xn2.Name == "li")
{
sb.Append(prefix + "*" + xn.InnerText);
sb.Append($"{prefix}*{xn.InnerText}");
}
if (xn2.Name == "p")
{
sb.Append(prefix + xn.InnerText);
sb.Append($"{prefix}{xn.InnerText}");
}
}
}
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Volian.Controls.Library
File diff suppressed because it is too large Load Diff
@@ -23,7 +23,6 @@ namespace Volian.Controls.Library
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
@@ -34,7 +33,6 @@ namespace Volian.Controls.Library
{
this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel();
this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel();
this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem();
this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.gpItem.SuspendLayout();
@@ -42,14 +40,14 @@ namespace Volian.Controls.Library
//
// btnApplicabilitychg
//
this.btnApplicabilitychg.Location = new System.Drawing.Point(60, 8);
this.btnApplicabilitychg.Location = new System.Drawing.Point(90, 8);
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4);
this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control;
this.btnApplicabilitychg.Name = "btnApplicabilitychg";
this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22);
this.btnApplicabilitychg.Size = new System.Drawing.Size(87, 22);
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2);
this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Set All at Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that the Set All at Level button is disabled for RNO step types unless they are substeps off of a RNO step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2026-034 fix tool tip text.
this.btnApplicabilitychg.TabIndex = 0;
this.btnApplicabilitychg.Text = "Set All at Level";
this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb;
@@ -106,13 +104,12 @@ namespace Volian.Controls.Library
this.gpItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.gpItem.CanvasColor = System.Drawing.SystemColors.Control;
this.gpItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
//this.gpItem.Controls.Add(this.btnApplicabilitychg);
this.gpItem.DisabledBackColor = System.Drawing.Color.Empty;
this.gpItem.Dock = System.Windows.Forms.DockStyle.Top;
this.gpItem.Location = new System.Drawing.Point(0, 49);
this.gpItem.Margin = new System.Windows.Forms.Padding(4);
this.gpItem.Name = "gpItem";
this.gpItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37);
this.gpItem.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0);
this.gpItem.Size = new System.Drawing.Size(432, 85);
//
//
@@ -169,9 +166,9 @@ namespace Volian.Controls.Library
private DevComponents.DotNetBar.Controls.GroupPanel gpMode;
private DevComponents.DotNetBar.Controls.GroupPanel gpItem;
private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2;
private DevComponents.DotNetBar.ButtonX btnApplicabilitychg;
private DevComponents.DotNetBar.SuperTooltip superTooltip1;
}
}
@@ -1,8 +1,6 @@
using JR.Utils.GUI.Forms;
using log4net.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
@@ -18,23 +16,26 @@ namespace Volian.Controls.Library
public event DisplayApplicabilityEvent ApplicabilityViewModeChanged;
private void OnApplicabilityViewModeChanged()
{
if (ApplicabilityViewModeChanged != null)
ApplicabilityViewModeChanged(this, new EventArgs());
}
ApplicabilityViewModeChanged?.Invoke(this, new EventArgs());
}
private DisplayTabItem _MyDisplayTabItem = null;
public DisplayTabItem MyDisplayTabItem
{
get { return _MyDisplayTabItem; }
set
{
if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface
if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface
_MyDisplayTabItem = value;
gpMode.Controls.Clear();
gpItem.Controls.Clear();
MyCheckBoxes.Clear();
if (_MyDisplayTabItem != null)
{
DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig;
//B2026-043 Fix "Set All At Level" button.
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem = InitializegpSubItem();
DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig;
List<string> names = new List<string>();
for (int n = 1; n <= dcfg.Unit_Count; n++)
{
@@ -42,7 +43,6 @@ namespace Volian.Controls.Library
names.Add(dcfg.Unit_Name);
}
dcfg.SelectedSlave = 0;
// string[] names = dcfg.Unit_Name.Split(',');
int apple = -1;
if(_MyDisplayTabItem.MyStepTabPanel != null)
apple = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.ApplDisplayMode;
@@ -51,14 +51,16 @@ namespace Volian.Controls.Library
foreach (string name in names)
{
i++;
AddViewMode(name.Trim(), i.ToString(), apple == i);
AddViewMode($"{name.Trim()} (View Only)", i.ToString(), apple == i);
}
AddItemMode("All", "-1");
AddItemMode("All", "-1", ref gpSubItem);
i = 0;
foreach (string name in names)
AddItemMode(name.Trim(), (++i).ToString());
AddItemMode("None", "0");
AddItemMode(name.Trim(), (++i).ToString(), ref gpSubItem);
AddItemMode("None", "0", ref gpSubItem);
gpItem.Controls.Add(gpSubItem);
gpSubItem.BringToFront();
gpItem.Controls.Add(btnApplicabilitychg);
btnApplicabilitychg.BringToFront();
if (_MyDisplayTabItem.MyStepTabPanel != null)
@@ -85,63 +87,69 @@ namespace Volian.Controls.Library
return 0;
}
}
private Dictionary<int, CheckBox> MyCheckBoxes = new Dictionary<int, CheckBox>();
private string _MyApplicability = string.Empty;
private DevComponents.DotNetBar.Controls.GroupPanel InitializegpSubItem() //B2026-043 Fix "Set All At Level" button.
{
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem;
gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel
{
AutoSize = true,
AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink,
CanvasColor = System.Drawing.SystemColors.Control,
ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007,
DisabledBackColor = System.Drawing.Color.Empty,
Dock = System.Windows.Forms.DockStyle.Top,
Location = new System.Drawing.Point(0, 49),
Margin = new System.Windows.Forms.Padding(4),
Name = "gpSubItem",
Padding = new System.Windows.Forms.Padding(13, 12, 13, 37),
BackColor = Color.Transparent
};
gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
gpSubItem.TabIndex = 1;
gpSubItem.Text = "";
gpSubItem.Location = new System.Drawing.Point(0, 49);
gpSubItem.Size = new System.Drawing.Size(400, 250);
return gpSubItem;
}
#pragma warning disable IDE0044 // Add readonly modifier
private Dictionary<int, CheckBox> MyCheckBoxes = new Dictionary<int, CheckBox>();
#pragma warning restore IDE0044 // Add readonly modifier
private string _MyApplicability = string.Empty;
public string MyApplicability
{
get { return _MyApplicability; }
set { _MyApplicability = value; }
}
//private ProcedureInfo _MyProcedureInfo;
//public ProcedureInfo MyProcedureInfo
//{
//get { return _MyProcedureInfo; }
//set
//{
// _MyProcedureInfo = value;
// if (_MyProcedureInfo != null && _MyProcedureInfo.IsProcedure)
// {
// DocVersionConfig cfg = new DocVersionConfig(_MyProcedureInfo.MyDocVersion);
// if (cfg.Unit_Name == string.Empty)
// this.Visible = false;
// else
// {
// string[] names = cfg.Unit_Name.Split(',');
// gpMode.Controls.Clear();
// gpItem.Controls.Clear();
// MyCheckBoxes.Clear();
// AddViewMode("Master", "-1", true);
// int i = 0;
// foreach (string name in names)
// {
// AddViewMode(name.Trim(), (++i).ToString());
// }
// AddItemMode("All", "-1");
// i = 0;
// foreach (string name in names)
// AddItemMode(name.Trim(), (++i).ToString());
// AddItemMode("None", "0");
// //if(!this.Visible)
// // this.Visible = true;
// }
// }
//}
//}
private void AddItemMode(string name, string value)
//C2026-021 Expand Functionality of Viewing Mode
public bool ShowItemSelection = true;
public void SetEnableDisableItemSelection(bool value) => gpItem.Enabled = ShowItemSelection = value;
private void AddItemMode(string name, string value, ref DevComponents.DotNetBar.Controls.GroupPanel gpSubItem)
{
CheckBox cb = new CheckBox();
cb.BackColor = Color.Transparent;
cb.Text = name;
cb.Tag = value;
cb.Dock = DockStyle.Top;
gpItem.Controls.Add(cb);
CheckBox cb = new CheckBox
{
BackColor = Color.Transparent,
Height = 24,
Width = 75,
AutoSize = true,
Text = name,
Tag = value,
Dock = DockStyle.Top
};
gpSubItem.Controls.Add(cb);
cb.BringToFront();
cb.CheckedChanged += new EventHandler(cb_CheckedChanged);
MyCheckBoxes.Add(value == null ? -1 : int.Parse(value), cb);
}
private void cb_CheckedChanged(object sender, EventArgs e)
{
EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text.
UnwireCheckboxes(false);
CheckBox cb = sender as CheckBox;
CheckState cs = cb.CheckState;
@@ -209,22 +217,10 @@ namespace Volian.Controls.Library
}
}
}
//IItemConfig cfg = MyItemInfo.MyConfig as IItemConfig;
//cfg.MasterSlave_Applicability.SetFlags(MyApplicability);
//Content c = Content.Get(MyItemInfo.MyContent.ContentID);
//c.Save();
//foreach (TransitionInfo ti in MyItemInfo.ItemTransitions_ToID)
//{
// if (!ti.MyItemToID.IsApplicable(MyApplicability))
// {
// MessageBox.Show("you can't do this");
// return;
// }
//}
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(MyItemInfo.ItemID, MyApplicability);
// B2021-149: for Procedure level PC/PC, continue processing if all 'invalid' transitions are internal (query used
// return internal and external for the procedure level)
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans))
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(invalidTrans))
{
// C2021 - 027: Procedure level PC/PC
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
@@ -265,20 +261,6 @@ namespace Volian.Controls.Library
// C2021 - 027: Procedure level PC/PC - checkbox for applicability changed, fix ribbon's menus
if (MyItemInfo.IsProcedure) _MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(MyItemInfo.MyDocVersion.UnitNames, MyItemInfo);
//using (Content cnt = Content.Get(MyItemInfo.MyContent.ContentID))
//{
// cnt.DTS = DateTime.Now;
// cnt.UserID = Volian.Base.Library.VlnSettings.UserID;
// //cnt.Save();
//}
//using (Step s = Step.Get(MyItemInfo.ItemID))
//{
// IItemConfig cfg = new StepConfig(s);
// cfg.MasterSlave_Applicability = new Volian.Base.Library.BigNum(MyApplicability);
// s.MyContent.Config = cfg.ToString();
// s.Save();
//}
}
private void BtnApplicabilitychg_Click(object sender, System.EventArgs e)
{
@@ -287,14 +269,18 @@ namespace Volian.Controls.Library
MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability;
StringBuilder sb = new StringBuilder();
EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text.
ItemInfo startitm = MyItemInfo.FirstSibling;
ItemInfo startitm = MyItemInfo.FirstSibling;
while (startitm != null)
{
// C2026-023: Check for Transitions when setting Applicability to all for a level
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(startitm.ItemID, MasterSlave_ApplicabilityTmp.ToString());
if (IsProcWithNoExternalTrans(startitm, invalidTrans))
if (IsProcWithNoExternalTrans(invalidTrans))
{
StepConfig sc2 = startitm.MyConfig as StepConfig;
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
@@ -334,7 +320,7 @@ namespace Volian.Controls.Library
}
// B2021-149: for procedure, only consider external transitions as invalid
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
private bool IsProcWithNoExternalTrans(List<InvalidTransition> invalidTrans)
{
if (invalidTrans.Count == 0) return true;
foreach (InvalidTransition iT in invalidTrans)
@@ -390,10 +376,18 @@ namespace Volian.Controls.Library
}
}
}
_MyItemInfo = value;
_MyItemInfo = value;
if (_MyItemInfo != null)
{
if (this.Visible == false) return;
if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button.
{
btnApplicabilitychg.Enabled = false;
}
else
{
btnApplicabilitychg.Enabled = true;
}
IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig;
List<int> apples = cfg.MasterSlave_Applicability.GetFlags();
UnwireCheckboxes(true);
@@ -441,18 +435,17 @@ namespace Volian.Controls.Library
foreach (CheckBox cb in MyCheckBoxes.Values)
cb.Enabled = true;
}
private void AddViewMode(string name, string value)
private void AddViewMode(string name, string value, bool selected)
{
AddViewMode(name, value, false);
}
private void AddViewMode(string name, string value, bool selected)
{
RadioButton rb = new RadioButton();
rb.BackColor = Color.Transparent;
rb.Text = name;
rb.Tag = value;
rb.Dock = DockStyle.Top;
gpMode.Controls.Add(rb);
RadioButton rb = new RadioButton
{
BackColor = Color.Transparent,
Text = name,
Tag = value,
Dock = DockStyle.Top
};
gpMode.Controls.Add(rb);
rb.BringToFront();
rb.Checked = selected;
rb.CheckedChanged += new EventHandler(rb_CheckedChanged);
@@ -476,7 +469,7 @@ namespace Volian.Controls.Library
// C2021 - 027: Procedure level PC/PC - handle procedure level too for viewing in editor
if (MyDisplayTabItem.MyStepTabPanel.SelectedItemInfo != null && MyDisplayTabItem.MyStepTabPanel.SelectedItemInfo.IsProcedure)
ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
if (ei != null) ei.MyStepRTB.Focus();
ei?.MyStepRTB.Focus();
}
}
@@ -489,14 +482,15 @@ namespace Volian.Controls.Library
public DisplayApplicability()
{
InitializeComponent();
InitializeComponent(); //B2026-043 Fix "Set All At Level" button.
this.VisibleChanged += new EventHandler(DisplayApplicability_VisibleChanged);
}
void DisplayApplicability_VisibleChanged(object sender, EventArgs e)
{
MyItemInfo = MyItemInfo;
gpItem.Enabled = UserInfo.CanEdit(MyUserInfo,(MyItemInfo == null) ? null : MyItemInfo.MyDocVersion); //Can Change Applicability
gpItem.Enabled = ShowItemSelection && UserInfo.CanEdit(MyUserInfo,MyItemInfo?.MyDocVersion); //Can Change Applicability
}
}
}
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using JR.Utils.GUI.Forms;
@@ -18,9 +13,8 @@ namespace Volian.Controls.Library
public event ResetBookMarksInPROMSWindowsEvent ResetBookMarksInPROMSWindows;
private void OnResetBookMarksInPROMSWindows()
{
if (ResetBookMarksInPROMSWindows != null)
ResetBookMarksInPROMSWindows(this, new EventArgs());
}
ResetBookMarksInPROMSWindows?.Invoke(this, new EventArgs());
}
#endregion //delegates and Events
#region Properties
private MostRecentItemList _MyBookMarks;
@@ -30,8 +24,7 @@ namespace Volian.Controls.Library
set { _MyBookMarks = value; }
}
private ItemInfo _CurItemInfo = null;
private bool _Initalizing = false;
private DisplayTabControl _MyDisplayTabControl;
private DisplayTabControl _MyDisplayTabControl;
public DisplayTabControl MyDisplayTabControl
{
get { return _MyDisplayTabControl; }
@@ -53,24 +46,11 @@ namespace Volian.Controls.Library
_CurItemInfo = MyEditItem.MyItemInfo;
}
}
//private StepRTB _MyRTB;
//public StepRTB MyRTB
//{
// get { return _MyRTB; }
// set
// {
// if (value == null) return;
// if (_CurItemInfo != null && _CurItemInfo.ItemID == value.MyItemInfo.ItemID) return;
// _MyRTB = value;
// _CurItemInfo = MyRTB.MyItemInfo;
// }
//}
#endregion
#region Constructors
public DisplayBookMarks()
{
InitializeComponent();
//SetupBookMarks();
}
public void SetupBookMarks()
{
@@ -81,9 +61,6 @@ namespace Volian.Controls.Library
}
lbxBookMarks.SelectedValueChanged += new EventHandler(lbxBookMarks_SelectedValueChanged);
RefreshBookMarkData();
//btnPrevPos.Enabled = false;
//lbxBookMarks.Enabled = false;
//_PrevBookMark = null;
}
void _MyBookMarks_AfterRemove(object sender)
@@ -92,8 +69,8 @@ namespace Volian.Controls.Library
}
private void RefreshBookMarkData()
{
ResetBookMarkList();
OnResetBookMarksInPROMSWindows(); // C2015-022 trigger event to update child PROMS windows with current bookmark list
ResetBookMarkList();
OnResetBookMarksInPROMSWindows(); // C2015-022 trigger event to update child PROMS windows with current bookmark list
SaveBookMarks();
}
@@ -148,10 +125,9 @@ namespace Volian.Controls.Library
}
private void lbxBookMarks_Click(object sender, EventArgs e)
{
MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem;
if(itm != null)
MyDisplayTabControl.OpenItem(itm.MyItemInfo);
}
if (lbxBookMarks.SelectedValue is MostRecentItem itm)
MyDisplayTabControl.OpenItem(itm.MyItemInfo);
}
#endregion
}
}
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
@@ -30,7 +26,7 @@ namespace Volian.Controls.Library
{
if (!DesignMode && _MainStepSection == null) // B2019-043 need to check if we are just saving changes to the user interface
{
foreach (SectionInfo si in MyItemInfo.MyProcedure.Sections)
foreach (SectionInfo si in MyItemInfo.MyProcedure.Sections.OfType<SectionInfo>())
{
SectionConfig sc = (SectionConfig)si.MyConfig;
if (sc.Section_OriginalSteps == "Y") _MainStepSection = si;
@@ -39,9 +35,6 @@ namespace Volian.Controls.Library
return _MainStepSection;
}
}
//private ItemInfo _firstStep;
//private ItemInfo _lastStep;
private bool _Initializing;
public DisplayFoldoutMaint()
{
@@ -56,11 +49,10 @@ namespace Volian.Controls.Library
if (MyItemInfo != null)
{
if (MyItemInfo.MyProcedure.Sections == null || MyItemInfo.MyProcedure.Sections.Count == 0) return;
_Initializing = true;
ProcedureInfo pi = MyItemInfo.MyProcedure;
listBoxFoldouts.Items.Clear();
lstCBSteps.Items.Clear();
foreach (SectionInfo si in pi.Sections)
foreach (SectionInfo si in pi.Sections.OfType<SectionInfo>())
if (si.DisplayText.ToUpper().StartsWith("FOLDOUT")) listBoxFoldouts.Items.Add(si);
if (listBoxFoldouts.Items.Count > 0) listBoxFoldouts.SelectedIndex = 0;
else
@@ -71,7 +63,6 @@ namespace Volian.Controls.Library
// find default step section & use its steps to fill in tree.
FillInSteps();
_Initializing = false;
}
}
private void FillInSteps()
@@ -80,19 +71,18 @@ namespace Volian.Controls.Library
ItemInfo startitm = MainStepSection.Steps != null && MainStepSection.Steps.Count > 0 ? MainStepSection.Steps[0] : null;
while (startitm != null)
{
StepConfig sc = startitm.MyConfig as StepConfig;
if (sc != null)
{
if (sc.Step_FloatingFoldout == foldOutselected.ItemID)
{
lstCBSteps.Items.Add(startitm, CheckState.Checked);
}
else
lstCBSteps.Items.Add(startitm, CheckState.Unchecked);
}
else
lstCBSteps.Items.Add(startitm, CheckState.Unchecked);
startitm = startitm.GetNext();
if (startitm.MyConfig is StepConfig sc)
{
if (sc.Step_FloatingFoldout == foldOutselected.ItemID)
{
lstCBSteps.Items.Add(startitm, CheckState.Checked);
}
else
lstCBSteps.Items.Add(startitm, CheckState.Unchecked);
}
else
lstCBSteps.Items.Add(startitm, CheckState.Unchecked);
startitm = startitm.GetNext();
}
}
private void listBoxFoldouts_SelectedIndexChanged(object sender, EventArgs e)
@@ -102,12 +92,11 @@ namespace Volian.Controls.Library
for (int i = 0; i < lstCBSteps.Items.Count; i++)
{
ItemInfo startitm = lstCBSteps.Items[i] as ItemInfo;
StepConfig sc = startitm.MyConfig as StepConfig;
if (sc != null)
lstCBSteps.SetItemChecked(itemInList, sc.Step_FloatingFoldout == foldOutselected.ItemID);
else
lstCBSteps.SetItemChecked(itemInList, false);
itemInList++;
if (startitm.MyConfig is StepConfig sc)
lstCBSteps.SetItemChecked(itemInList, sc.Step_FloatingFoldout == foldOutselected.ItemID);
else
lstCBSteps.SetItemChecked(itemInList, false);
itemInList++;
}
}
private void btnSave_Click(object sender, EventArgs e)
+45 -237
View File
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using System.IO;
@@ -11,7 +9,7 @@ using System.Text.RegularExpressions;
using JR.Utils.GUI.Forms;
using Volian.Base.Library;
using System.Linq;
namespace Volian.Controls.Library
{
public partial class DisplayHistory : UserControl
@@ -21,30 +19,22 @@ namespace Volian.Controls.Library
public event DisplayHistoryReportEvent SummaryPrintRequest;
private void OnChronologyPrintRequest(DisplayHistoryReportEventArgs args)
{
if (ChronologyPrintRequest != null)
ChronologyPrintRequest(this, args);
}
ChronologyPrintRequest?.Invoke(this, args);
}
private void OnSummaryPrintRequest(DisplayHistoryReportEventArgs args)
{
if (SummaryPrintRequest != null)
SummaryPrintRequest(this, args);
}
SummaryPrintRequest?.Invoke(this, args);
}
public event DisplayHistoryEvent HistorySelectionChanged;
private void OnHistorySelectionChanged(DisplayHistoryEventArgs args)
{
if (HistorySelectionChanged != null)
HistorySelectionChanged(this, args);
}
public event ItemRestoredHandler ItemRestored;
private void OnItemRestored(ItemInfo restoredItemInfo)
{
if (ItemRestored != null) ItemRestored(restoredItemInfo);
}
HistorySelectionChanged?.Invoke(this, args);
}
public event AnnotationRestoredHandler AnnotationRestored;
private void OnAnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem)
{
if (AnnotationRestored != null) AnnotationRestored(restoredAnnotationInfo, currentItem);
}
AnnotationRestored?.Invoke(restoredAnnotationInfo, currentItem);
}
#endregion
private ContentAuditInfoList _ChronologyAuditList;
private ContentAuditInfoList _SummaryAuditList;
@@ -176,10 +166,8 @@ namespace Volian.Controls.Library
SetRevDate(MyProcedureInfo.DTS);
else
{
DateTime revDate;
if (!DateTime.TryParse(cfg.Print_RevDate, out revDate)) revDate = MyProcedureInfo.ChangeBarDate; // DateTime.Now;
SetRevDate(revDate);
//SetRevDate(DateTime.Parse(cfg.Print_RevDate));
if (!DateTime.TryParse(cfg.Print_RevDate, out DateTime revDate)) revDate = MyProcedureInfo.ChangeBarDate; // DateTime.Now;
SetRevDate(revDate);
}
}
}
@@ -222,42 +210,39 @@ namespace Volian.Controls.Library
{
if (lbChanges.SelectedIndex > -1)
{
ContentAuditInfo cai = lbChanges.SelectedItem as ContentAuditInfo;
if (cai != null)
{
// The following line was incorrectly showing a message stating that the item was deleted when it was not.
//if (cai.DeleteStatus > 0 || (cai.DeleteStatus == 0 && cai.ActionWhen.Year == DateTime.MinValue.Year))
if (cai.DeleteStatus > 0)
FlexibleMessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
else
{
try
{
OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID));
}
// If the selected item is deleted display a message rather than crashing
catch (Exception ex)
{
FlexibleMessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
else
{
AnnotationAuditInfo aai = lbChanges.SelectedItem as AnnotationAuditInfo;
OnHistorySelectionChanged(new DisplayHistoryEventArgs(aai.ItemID));
}
}
if (lbChanges.SelectedItem is ContentAuditInfo cai)
{
// The following line was incorrectly showing a message stating that the item was deleted when it was not.
//if (cai.DeleteStatus > 0 || (cai.DeleteStatus == 0 && cai.ActionWhen.Year == DateTime.MinValue.Year))
if (cai.DeleteStatus > 0)
FlexibleMessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
else
{
try
{
OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID));
}
// If the selected item is deleted display a message rather than crashing
catch (Exception)
{
FlexibleMessageBox.Show("This item has been deleted.", "Deleted Item", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
else
{
AnnotationAuditInfo aai = lbChanges.SelectedItem as AnnotationAuditInfo;
OnHistorySelectionChanged(new DisplayHistoryEventArgs(aai.ItemID));
}
}
}
private void UpdateHistory()
{
this.Cursor = Cursors.WaitCursor;
//DateTime start = DateTime.Now;
//Console.WriteLine(start);
#region setup
btnRestore.Enabled = false;
myRTB.Clear();
//myRTB.LastRtf = string.Empty;
myVFG.Clear();
myPicBox.Image = null;
if (!tvAudits.IsDisposed) // fixes a crash that happend while debugging separate windows, have not been able to reproduce. left this IF check in just in case. - jsj 2-1-2018
@@ -269,8 +254,6 @@ namespace Volian.Controls.Library
}
MyItemInfo.RefreshItemAnnotations();
#endregion
//if (AnnotationOnly)
//{
#region annotation deleted
//annotation deleted by itemid
TreeNode annotationDeleted = null;
@@ -319,14 +302,11 @@ namespace Volian.Controls.Library
}
//end annotation change
#endregion
// return;
//}
#region content changes
//content changes
TreeNode contentHistory = null;
if (MyItemInfo == null) return;
ContentAuditInfoList cail = ContentAuditInfoList.Get(MyItemInfo.ContentID, MyItemInfo.MyProcedure.DTS);
// ContentAuditInfoList cail = ContentAuditInfoList.GetChronology(MyItemInfo.MyProcedure.ItemID, MyItemInfo.ItemID, false);
ContentInfo ci = ContentInfo.Get(MyItemInfo.ContentID);
foreach (ContentAuditInfo cai in cail)
{
@@ -378,155 +358,10 @@ namespace Volian.Controls.Library
#endregion
#region items
TreeNode deletedItems = null;
TreeNode previousItem = null;
TreeNode nextItem = null;
TreeNode procedurePart = null;
TreeNode sectionPart = null;
TreeNode cautionPart = null;
TreeNode notePart = null;
TreeNode rnoPart = null;
TreeNode stepPart = null;
TreeNode tablePart = null;
#endregion
ItemAuditInfoList iail = ItemAuditInfoList.Get(MyItemInfo.ItemID);
foreach (ItemAuditInfo iai in iail)
{
#region old style
// switch (iai.Level)
// {
// #region previous item
// case 0: //previous item
// {
// #region old style
// //if (previousItem == null)
// // previousItem = tvAudits.Nodes.Add("Deleted Previous Item"); //previousItem = tvAudits.Nodes.Add("Previous Item");
// //TreeNode tn = previousItem.Nodes.Add(iai.ToString());
// //tn.Tag = iai;
// #endregion
// #region new style
// if (deletedItems == null)
// deletedItems = tvAudits.Nodes.Add("Deleted Items");
// TreeNode tnn = deletedItems.Nodes.Add(iai.ToString());
// tnn.Tag = iai;
// #endregion
// break;
// }
// #endregion
// #region next item
// case 1: //next item
// {
// #region old style
// //if (nextItem == null)
// // nextItem = tvAudits.Nodes.Add("Deleted Next Item"); //nextItem = tvAudits.Nodes.Add("Next Item");
// //TreeNode tn = nextItem.Nodes.Add(iai.ToString());
// //tn.Tag = iai;
// #endregion
// #region new style
// if (deletedItems == null)
// deletedItems = tvAudits.Nodes.Add("Deleted Items");
// TreeNode tnn = deletedItems.Nodes.Add(iai.ToString());
// tnn.Tag = iai;
// #endregion
// break;
// }
// #endregion
// case 2: //parts
// {
// #region old style
// //PartAuditInfoList pail = null;
// //pail = PartAuditInfoList.GetByDeleteStatus(iai.DeleteStatus);
// //if (pail.Count == 0)
// // pail = PartAuditInfoList.GetByItemID(iai.ItemID);
// //foreach (PartAuditInfo pai in pail)
// //{
// // if (pai.ContentID == MyItemInfo.ContentID)
// // {
// // switch (pai.FromType)
// // {
// // #region procedure part
// // case 1: //procedures
// // {
// // if (procedurePart == null)
// // procedurePart = tvAudits.Nodes.Add("Deleted Procedures"); //procedurePart = tvAudits.Nodes.Add("Procedures");
// // TreeNode tn = procedurePart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region section part
// // case 2: //sections
// // {
// // if (sectionPart == null)
// // sectionPart = tvAudits.Nodes.Add("Deleted Sections"); //sectionPart = tvAudits.Nodes.Add("Sections");
// // TreeNode tn = sectionPart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region caution part
// // case 3: //cautions
// // {
// // if (cautionPart == null)
// // cautionPart = tvAudits.Nodes.Add("Deleted Cautions"); //cautionPart = tvAudits.Nodes.Add("Cautions");
// // TreeNode tn = cautionPart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region note part
// // case 4: //notes
// // {
// // if (notePart == null)
// // notePart = tvAudits.Nodes.Add("Deleted Notes"); //notePart = tvAudits.Nodes.Add("Notes");
// // TreeNode tn = notePart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region rno part
// // case 5: //rnos
// // {
// // if (rnoPart == null)
// // rnoPart = tvAudits.Nodes.Add("Deleted RNOs"); //rnoPart = tvAudits.Nodes.Add("RNOs");
// // TreeNode tn = rnoPart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region step part
// // case 6: //steps
// // {
// // if (stepPart == null)
// // stepPart = tvAudits.Nodes.Add("Deleted Steps"); //stepPart = tvAudits.Nodes.Add("Steps");
// // TreeNode tn = stepPart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // #region table part
// // case 7: //tables
// // {
// // if (tablePart == null)
// // tablePart = tvAudits.Nodes.Add("Deleted Tables"); //tablePart = tvAudits.Nodes.Add("Tables");
// // TreeNode tn = tablePart.Nodes.Add(iai.ToString());
// // tn.Tag = iai;
// // break;
// // }
// // #endregion
// // }
// // }
// //}
// #endregion
// #region new style
// if (deletedItems == null)
// deletedItems = tvAudits.Nodes.Add("Deleted Items");
// TreeNode tnn = deletedItems.Nodes.Add(iai.ToString());
// tnn.Tag = iai;
// #endregion
// break;
// }
//}
#endregion
#region new style
// B2023-117 if DeleteStatus is zero,don't try to get Audit Info List
if (iai.DeleteStatus == 0) continue;
@@ -552,7 +387,7 @@ namespace Volian.Controls.Library
}
}
}
TreeNode tnn = deletedItems.Nodes.Add(iai.ToString() + "; Reason: " + strR);
TreeNode tnn = deletedItems.Nodes.Add($"{iai}; Reason: {strR}");
tnn.Tag = iai;
#endregion
}
@@ -572,10 +407,8 @@ namespace Volian.Controls.Library
}
private void WalkProcedure()
{
//return;
this.ParentForm.Cursor = Cursors.WaitCursor;
Application.DoEvents();
//DateTime start = DateTime.Now;
//Console.WriteLine(start);
lbChanges.Items.Clear();
if (MyProcedureInfo == null)
@@ -584,10 +417,10 @@ namespace Volian.Controls.Library
btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = cbSumExcludeAnn.Enabled = DT_SumAsOf.Enabled = lbChanges.Items.Count > 0;
return;
}
ContentAuditInfoList cail2;
ContentAuditInfoList cail3;
AnnotationAuditInfoList aail2;
if (ApplDisplayMode > 0)
ContentAuditInfoList cail2;
ContentAuditInfoList cail3;
AnnotationAuditInfoList aail2;
if (ApplDisplayMode > 0)
{
cail2 = ContentAuditInfoList.GetChronologyByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode, MyProcedureInfo.ChangeBarDate);
cail3 = ContentAuditInfoList.GetSummaryByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode, MyProcedureInfo.ChangeBarDate);
@@ -611,8 +444,8 @@ namespace Volian.Controls.Library
// in the list box and should not be because some MyRevDate's did not have time included.
if (CompareDateOrDateTime(cai.DTS, MyRevDate) || cai.ActionWhen > MyRevDate)
{
string itemTitle = FixPath(cai.Path);
lbChanges.Items.Add(cai);
_ = FixPath(cai.Path);
lbChanges.Items.Add(cai);
}
}
foreach (AnnotationAuditInfo aai in aail2)
@@ -630,7 +463,7 @@ namespace Volian.Controls.Library
{
ItemInfo iii = aai.MyItemInfo;
if (iii != null)
stepnum = FixPath(iii.SearchPath);
_ = FixPath(iii.SearchPath);
}
if (aai.DTS > MyRevDate)
lbChanges.Items.Add(aai);
@@ -650,25 +483,13 @@ namespace Volian.Controls.Library
private void btnViewChronologyReport_Click(object sender, EventArgs e)
{
RefreshList();
//if (lbChanges.Items.Count > 0)
//{
//jcb added 20120425 to suppress annotations in report
//jcb commented out 20130409 per bug C2012-022
//_AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0, MyProcedureInfo.ChangeBarDate);
//added setting selected slave in order for reports to replace unit number,etc jcb 20101010
MyItemInfo.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = ApplDisplayMode;
// OnChronologyPrintRequest(new DisplayHistoryReportEventArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyChronology.pdf", MyItemInfo.MyProcedure, _ChronologyAuditList, _AnnotationList));
OnChronologyPrintRequest(new DisplayHistoryReportEventArgs(string.Format(@"{0}\{1} Chronology of Changes.pdf", Volian.Base.Library.VlnSettings.TemporaryFolder, MyItemInfo.MyProcedure.PDFNumber), MyItemInfo.MyProcedure, _ChronologyAuditList, _AnnotationList));
//}
}
private void btnViewSummaryReport_Click(object sender, EventArgs e)
{
RefreshList();
//if (lbChanges.Items.Count > 0)
//{
//jcb added 20120425 to suppress annotations in report
//jcb commented out 20130409 per bug C2012-022
//_AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0, MyProcedureInfo.ChangeBarDate);
//added setting selected slave in order for reports to replace unit number,etc jcb 20101010
MyItemInfo.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = ApplDisplayMode;
@@ -676,7 +497,6 @@ namespace Volian.Controls.Library
//C2024- 038 - Summary of Changes report generation enhancements
//check if need to modify
// _SummaryAuditList
if (DT_SumAsOf.Checked)
dhr.AuditList = FilterSummaryByDate(_SummaryAuditList, DT_SumAsOf.Value);
else
@@ -685,7 +505,6 @@ namespace Volian.Controls.Library
//C2024- 038 - Summary of Changes report generation enhancements
// if Exclude Annotations Checked
// send an empty list instead of
//_AnnotationList
if (cbSumExcludeAnn.Checked)
dhr.AnnotationList = new AnnotationAuditInfoList(null);
else if (DT_SumAsOf.Checked)
@@ -799,11 +618,7 @@ namespace Volian.Controls.Library
if (myRoFst != null) myRoFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
ii = MyItemInfo.RestoreItem(iai, myRoFst);
if (myRoFst != null) myRoFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(myRoFst_ROTableUpdate);
//_MyEditItem.AddChild((E_FromType)fromtype, contenttype);
//ii.ItemParts[0].FromType
//ii.MyContent.Type
EditItem nextItem = MyEditItem.GetNextItem((E_FromType)ii.ItemParts[0].FromType, ii);
//MyEditItem.AddChild(ii.MyContent.Text, (E_FromType)ii.ItemParts[0].FromType, (int)ii.MyContent.Type, null);
if (ii.IsStep)
ii = StepInfo.Get(ii.ItemID);
else if (ii.IsSection)
@@ -1051,10 +866,6 @@ namespace Volian.Controls.Library
myRTB.Visible = true;
myRTB.BringToFront();
myVFG.Visible = false;
// myRTB.Font = new Font("Arial", 12, FontStyle.Regular);
// myRTB.Text = cai.Text;
//myRTB.SetupRichText("bozo", MyItemInfo.FormatStepData == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font : MyItemInfo.FormatStepData.Font);
//myRTB.LastRtf = string.Empty;
myRTB.SetupRichText(cai.Text, MyItemInfo.FormatStepData == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font : MyItemInfo.FormatStepData.Font);
}
}
@@ -1067,8 +878,6 @@ namespace Volian.Controls.Library
{
if (cai.DeleteStatus == iai.DeleteStatus)
{
//myRTB.Font = new Font("Arial", 12, FontStyle.Regular);
//myRTB.Text = cai.Text;
myRTB.SetupRichText(cai.Text, MyItemInfo.FormatStepData == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font : MyItemInfo.FormatStepData.Font);
}
}
@@ -1079,7 +888,6 @@ namespace Volian.Controls.Library
AnnotationAuditInfo iai = tn.Tag as AnnotationAuditInfo;
myRTB.Font = new Font("Arial", 12, FontStyle.Regular);
myRTB.Rtf = iai.RtfText;
//myRTB.Rtf = iai.RtfText;
}
}
else
@@ -1121,7 +929,7 @@ namespace Volian.Controls.Library
myTimer.Enabled = true;
}
// B2019-161 When tracking timing time this action
private static VolianTimer _TimeActivity = new VolianTimer("DisplayHistory myTimer_Tick", 974);
private static readonly VolianTimer _TimeActivity = new VolianTimer("DisplayHistory myTimer_Tick", 974);
private void myTimer_Tick(object sender, System.EventArgs e)
{
+14 -39
View File
@@ -1,14 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;
using AT.STO.UI.Win;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
@@ -30,7 +23,7 @@ namespace Volian.Controls.Library
get { return _LibDocList; }
set { _LibDocList = value; }
}
private Color saveGroupPanelUsages;
private readonly Color saveGroupPanelUsages;
#endregion
#region Constructors
public DisplayLibDocs()
@@ -76,9 +69,8 @@ namespace Volian.Controls.Library
public event DisplayLibDocEvent PrintRequest;
private void OnPrintRequest(DisplayLibDocEventArgs args)
{
if (PrintRequest != null)
PrintRequest(this, args);
}
PrintRequest?.Invoke(this, args);
}
private void listBoxLibDocs_Click(object sender, EventArgs e)
{
@@ -125,9 +117,9 @@ namespace Volian.Controls.Library
foreach (ItemInfo ii in dicnt.LibraryDocumentUsageList)
{
if (ii.MyDocVersion != null)
listBoxUsages.Items.Add(ii.MyProcedure.ToString() + " - " + ii.DisplayNumber + " " + ii.DisplayText);
listBoxUsages.Items.Add($"{ii.MyProcedure} - {ii.DisplayNumber} {ii.DisplayText}");
}
btnPrint.Enabled = listBoxLibDocs.Items.Count > 0 ? true : false;
btnPrint.Enabled = listBoxLibDocs.Items.Count > 0;
}
private void btnDelLibDoc_Click(object sender, EventArgs e)
{
@@ -139,7 +131,7 @@ namespace Volian.Controls.Library
}
catch (Exception ex)
{
Console.WriteLine("error deleting doc = " + ex.Message);
Console.WriteLine($"error deleting doc = {ex.Message}");
}
LibDocListFillIn(_DisplayTabControl);
}
@@ -203,14 +195,15 @@ namespace Volian.Controls.Library
private void btnImpLibDoc_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
OpenFileDialog openFileDialog1 = new OpenFileDialog
{
InitialDirectory = "c:\\",
Filter = "Word files (*.doc;*.rtf;*.docx)|*.doc;*.rtf;*.docx|All files (*.*)|*.*",
FilterIndex = 0,
RestoreDirectory = true
};
openFileDialog1.InitialDirectory = "c:\\";
openFileDialog1.Filter = "Word files (*.doc;*.rtf;*.docx)|*.doc;*.rtf;*.docx|All files (*.*)|*.*";
openFileDialog1.FilterIndex = 0;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
int done = 0;
int ntry = 0;
@@ -352,24 +345,6 @@ namespace Volian.Controls.Library
get { return _PaperSize; }
set { _PaperSize = value; }
}
//private string _SearchString = null;
//public string SearchString
//{
// get { return _SearchString; }
// set { _SearchString = value; }
//}
//private string _TypesSelected;
//public string TypesSelected
//{
// get { return _TypesSelected; }
// set { _TypesSelected = value; }
//}
//private ICollection<ItemInfo> _MyItemInfoList;
//public ICollection<ItemInfo> MyItemInfoList
//{
// get { return _MyItemInfoList; }
// set { _MyItemInfoList = value; }
//}
public DisplayLibDocEventArgs(string reportTitle, DocumentInfoList libDocList, string paperSize)
{
_ReportTitle = reportTitle;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+134 -204
View File
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms;
using Volian.Base.Library;
@@ -59,14 +56,8 @@ namespace Volian.Controls.Library
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
private static bool _SyncronizeEnahnced = false;
public static bool SyncronizeEnhanced
{
get { return DisplayTabControl._SyncronizeEnahnced; }
set { DisplayTabControl._SyncronizeEnahnced = value; }
}
private static Dictionary<int, DisplayTabControl> _AllDTCs = new Dictionary<int, DisplayTabControl>();
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private static Dictionary<int, DisplayTabControl> _AllDTCs = new Dictionary<int, DisplayTabControl>();
private int _VersionID = 0;
// zero tells us to PROMS just opened and no procedure was selected yet so use the main proms window
// when the first procedure is opened, the VersionID is set and added to _AllDTCs
@@ -75,11 +66,11 @@ namespace Volian.Controls.Library
get { return _VersionID; }
set
{
if ((int)value != 0)
if (value != 0)
{
if (!_AllDTCs.ContainsKey((int)value))
{
_AllDTCs.Add((int)value, this);
_AllDTCs.Add(value, this);
if (_VersionID == 0)
_VersionID = value;
else
@@ -145,18 +136,11 @@ namespace Volian.Controls.Library
return (verIdList.Count > 1);
}
}
//public event ItemSelectedChangedEvent OpenEnhancedDocument;
//public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
//{
// if (OpenEnhancedDocument != null)
// OpenEnhancedDocument(this, args);
//}
public event ItemSelectedChangedEvent OpenInSeparateWindow;
public void OnOpenInSeparateWindow(ItemSelectedChangedEventArgs args)
{
if (OpenInSeparateWindow != null)
OpenInSeparateWindow(this, args);
}
OpenInSeparateWindow?.Invoke(this, args);
}
// C2020-033: Provide way to expand/fill in Search/Incoming Transition panel
public event DisplayTabControlEditorSearchIncTransEvent SearchIncTrans;
public ItemInfo OnSearchIncTrans(object sender, vlnTreeItemInfoEventArgs args)
@@ -167,42 +151,40 @@ namespace Volian.Controls.Library
public event ItemSelectedChangedEvent RefreshEnhancedDocument;
public void OnRefreshEnhancedDocument(ItemSelectedChangedEventArgs args)
{
if (RefreshEnhancedDocument != null)
RefreshEnhancedDocument(this, args);
}
RefreshEnhancedDocument?.Invoke(this, args);
}
public event DisplayTabControlStatusEvent StatusChanged;
public void ONStatusChanged(object Sender, DisplayTabControlStatusEventArgs args)
{
if (StatusChanged != null) StatusChanged(Sender, args);
}
StatusChanged?.Invoke(Sender, args);
}
public event DisplayTabControlEvent ToggleRibbonExpanded;
public void OnToggleRibbonExpanded(object sender, EventArgs args)
{
if (ToggleRibbonExpanded != null) ToggleRibbonExpanded(sender, args);
}
ToggleRibbonExpanded?.Invoke(sender, args);
}
public event DisplayTabControlEvent SelectedDisplayTabItemChanged;
public void OnSelectedDisplayTabItemChanged(object sender, EventArgs args)
{
if (SelectedDisplayTabItemChanged != null) SelectedDisplayTabItemChanged(sender, args);
}
SelectedDisplayTabItemChanged?.Invoke(sender, args);
}
// C2015-022 added copystep event to commuicate with child windows
public event ItemChangedEventHandler CopyStepSelected;
public void OnCopyStepSelected(ItemChangedEventArgs args)
{
if (CopyStepSelected != null)
CopyStepSelected(this, args);
}
CopyStepSelected?.Invoke(this, args);
}
#region Private Fields
#region Private Fields
/// <summary>
/// This is a lookup table for all of the DisplayTabItems that are currently open
/// The key is:
/// "Item - " + Procedure ItemID for step pages
/// "Doc - " + DocumentID for Word Documents
/// </summary>
public Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
/// <summary>
/// This is a lookup table for all of the DisplayTabItems that are currently open
/// The key is:
/// "Item - " + Procedure ItemID for step pages
/// "Doc - " + DocumentID for Word Documents
/// </summary>
public Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
/// <summary>
/// When a Tab is closed it is added to this list.
@@ -234,6 +216,8 @@ namespace Volian.Controls.Library
}
private StepRTB _MyStepRTB = null;
private bool _RibbonExpanded = true;
//Keeping for possible future references
public StepRTB MyStepRTB
{
get { return _MyStepRTB; }
@@ -308,8 +292,8 @@ namespace Volian.Controls.Library
/// <param name="args"></param>
internal void OnItemClick(object sender, StepPanelEventArgs args)
{
if (ItemClick != null) ItemClick(sender, args);
}
ItemClick?.Invoke(sender, args);
}
/// <summary>
/// This occurs when the user moves onto or off of a link within a RichTextBox
/// or moves between RichTextBoxes or Pages.
@@ -414,8 +398,8 @@ namespace Volian.Controls.Library
_MyEditItem = null;
_MyStepRTB = null;
}
if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args);
}
ItemSelectedChanged?.Invoke(sender, args);
}
void _MyStepRTB_Disposed(object sender, EventArgs e)
{
@@ -482,8 +466,7 @@ namespace Volian.Controls.Library
void DisplayTabControl_Resize(object sender, EventArgs e)
{
// If the currently selected Item is in a Step, then adjust the scroll as necessary to keep it visible
if (_MyEditItem != null)
_MyEditItem.ItemShow();
_MyEditItem?.ItemShow();
}
private void SetupBar(Bar myBar)
{
@@ -537,29 +520,32 @@ namespace Volian.Controls.Library
DisplayTabItem dti = e.DockContainerItem as DisplayTabItem;
if (dti != null && dti.MyStepTabPanel != null)
dti.MyStepTabPanel.MyStepPanel.Dispose();
DisplayTabItem myTabItem = e.DockContainerItem as DisplayTabItem;
if (myTabItem != null)
{
if (myTabItem.MyDSOTabPanel != null)
{
myTabItem.MyDSOTabPanel.CloseDSO();
}
}
MySessionInfo.CheckInItem(dti.OwnerID);
if (e.DockContainerItem is DisplayTabItem myTabItem)
{
myTabItem.MyDSOTabPanel?.CloseDSO();
}
MySessionInfo.CheckInItem(dti.OwnerID);
if (((Bar)sender).Items == null) return;
if (((Bar)sender).Items.Count == 1)// Remove bar if last item is closed...
{
Bar bar = sender as Bar;
if (bar != null)
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
//if last item is closing, need to re-enable Step Properties
//so if closing in view only mode will not freeze when re-opening
if (MyEditItem != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
{
if (dotNetBarManager1.Bars.Contains(bar.Name))
dotNetBarManager1.Bars.Remove(bar);
ActivateRemainingTab();
}
// B2018-123 the last tab in the main window was closed.
// remove the procedure version id from the _AllDTCs dictionary
// reset VersionID to zero so that we know the main window is available
_AllDTCs.Remove(VersionID);
OnEnableDisableStepProperties(new StepTabRibbonEventArgs(MyEditItem.MyItemInfo, 0, E_ViewMode.Edit));
}
if (sender is Bar bar)
{
if (dotNetBarManager1.Bars.Contains(bar.Name))
dotNetBarManager1.Bars.Remove(bar);
ActivateRemainingTab();
}
// B2018-123 the last tab in the main window was closed.
// remove the procedure version id from the _AllDTCs dictionary
// reset VersionID to zero so that we know the main window is available
_AllDTCs.Remove(VersionID);
VersionID = 0;
}
else
@@ -568,12 +554,18 @@ namespace Volian.Controls.Library
ActivateRemainingTab((Bar)sender);
}
}
#endregion
#region Public Methods
public void RefreshItem(ItemInfo myItemInfo)
public event StepTabRibbonEvent EnableDisableStepProperties;
private void OnEnableDisableStepProperties(StepTabRibbonEventArgs args)
{
EnableDisableStepProperties?.Invoke(this, args);
}
#endregion
#region Public Methods
public void RefreshItem(ItemInfo myItemInfo)
{
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
string key = $"Item - {proc.ItemID}";
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
{
@@ -708,9 +700,8 @@ namespace Volian.Controls.Library
if (EDOfficeViewerX == null || EDWordCtrl == null)
{
MessageBox.Show("Edraw needs to be installed or reinstalled on this device. " + Environment.NewLine + "" + Environment.NewLine +
"Please contact your IT Administrator to install and register Edraw that was provided with the PROMS Installation media. If additional support is needed, please contact Volian.", "Error in Word section",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show($"Edraw needs to be installed or reinstalled on this device. {Environment.NewLine}{Environment.NewLine}Please contact your IT Administrator to install and register Edraw that was provided with the PROMS Installation media. If additional support is needed, please contact Volian.",
"Error in Word section", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return null;
}
else
@@ -721,19 +712,13 @@ namespace Volian.Controls.Library
}
}
public T GetValue<T>(string registryKeyPath, string value, T defaultValue = default(T))
{
T retVal = default(T);
retVal = (T)Registry.GetValue(registryKeyPath, value, defaultValue);
return retVal;
}
public bool PasteRTBItem(ItemInfo myItemInfo, int copyStartID, ItemInfo.EAddpingPart pasteType, int type)
public T GetValue<T>(string registryKeyPath, string value, T defaultValue = default) => (T)Registry.GetValue(registryKeyPath, value, defaultValue);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping type for future usage")]
public bool PasteRTBItem(ItemInfo myItemInfo, int copyStartID, ItemInfo.EAddpingPart pasteType, int type)
{
CleanUpClosedItems();
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
string key = $"Item - {proc.ItemID}";
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
{
@@ -760,7 +745,7 @@ namespace Volian.Controls.Library
EditItem ei = edtitm.PasteReplace(copyStartID);
if (ei == null)
{
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
CloseTabItem(_MyDisplayTabItems[$"Item - {myItemInfo.ItemID}"]); //Grab itemID and set to close open tab.
return false; //B2017-179 PasteReplace will return null if was aborted
}
@@ -779,7 +764,7 @@ namespace Volian.Controls.Library
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
{
// B2024-038: changed tab key to procedure (was item, which caused crash if section)
CloseTabItem(_MyDisplayTabItems["Item - " + proc.ItemID.ToString()]); //Grab itemID and set to close open tab.
CloseTabItem(_MyDisplayTabItems[$"Item - {proc.ItemID}"]); //Grab itemID and set to close open tab.
return false; //B2017-179 PasteReplace will return null if was aborted
}
return false;
@@ -791,7 +776,7 @@ namespace Volian.Controls.Library
//removeitem!
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
string key = $"Item - {proc.ItemID}";
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
{
@@ -817,7 +802,7 @@ namespace Volian.Controls.Library
{
CleanUpClosedItems();
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
string key = $"Item - {proc.ItemID}";
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
{
@@ -866,17 +851,16 @@ namespace Volian.Controls.Library
string key = "Doc - ";
// there is no entry if it is an auto table of contents:
if (myItemInfo.MyContent.MyEntry != null)
key = key + myItemInfo.MyContent.MyEntry.MyDocument.DocID.ToString();
key += myItemInfo.MyContent.MyEntry.MyDocument.DocID.ToString();
else
key = key + "0";
DisplayTabItem myTabItem = null;
if (_MyDisplayTabItems.ContainsKey(key)) // If page open, close it
key += "0";
if (_MyDisplayTabItems.ContainsKey(key)) // If page open, close it
{
myTabItem = _MyDisplayTabItems[key];
if (myTabItem.MyDSOTabPanel != null)
_ = _MyDisplayTabItems[key];
if (((DisplayTabItem)null).MyDSOTabPanel != null)
{
myTabItem.MyDSOTabPanel.IsBeingDeleted = isBeingDeleted;
CloseTabItem(myTabItem);
((DisplayTabItem)null).MyDSOTabPanel.IsBeingDeleted = isBeingDeleted;
CloseTabItem(null);
}
}
}
@@ -884,14 +868,22 @@ namespace Volian.Controls.Library
public void CloseTabItem(DisplayTabItem myTabItem)
{
if (myTabItem.ContainerControl == null) return;
Bar b = myTabItem.ContainerControl as Bar;
if (b != null)
{
b.CloseDockTab(myTabItem);
//b.Items.Remove(myTabItem);
RemoveItem(myTabItem);
}
}
if (myTabItem.ContainerControl is Bar b)
{
try
{
b.CloseDockTab(myTabItem);
}
catch
{
//This is to work around a bug inside 3rd party DotNetBar
//The bug occurs when events happen out of order and it tries
//to remove a TabItem from the Collection the has already been removed
}
RemoveItem(myTabItem);
}
}
/// <summary>
/// Look for a tab and set it to active.
/// </summary>
@@ -930,10 +922,9 @@ namespace Volian.Controls.Library
if (_RemovedDisplayTabItems.Contains(myBar.SelectedDockContainerItem as DisplayTabItem))
myBar.SelectedDockContainerItem = FindRemainingTab(myBar);
myBar.SelectedDockContainerItem.Selected = true;
StepTabPanel pnl = myBar.SelectedDockContainerItem.Control as StepTabPanel;
if (pnl != null)
pnl.MyStepPanel.ItemShow();
}
if (myBar.SelectedDockContainerItem.Control is StepTabPanel pnl)
pnl.MyStepPanel.ItemShow();
}
}
#endregion
#region Public Properties
@@ -1017,7 +1008,7 @@ namespace Volian.Controls.Library
PnlCaret.Visible = false;
}
// B2019-161 When tracking timing time this action
private static VolianTimer _TimeActivity = new VolianTimer("DisplayTabControl.cs tmrCaret_Tick", 881);
private static readonly VolianTimer _TimeActivity = new VolianTimer("DisplayTabControl.cs tmrCaret_Tick", 881);
private void tmrCaret_Tick(object sender, EventArgs e)
{
@@ -1027,22 +1018,6 @@ namespace Volian.Controls.Library
}
#endregion
#region Private Methods
///// <summary>
///// Gets and sets the SelectedDisplayTabItem (Active Tab)
///// </summary>
//public DisplayTabItem SelectedDisplayTabItem1
//{
// get { return (DisplayTabItem)_MyBar.SelectedDockContainerItem; }
// set
// {
// //Volian.Base.Library.vlnStackTrace.ShowStackLocal("SelectedDisplayTabItem");
// if (value != null)
// {
// value.Focus();
// value.Selected = true;
// }
// }
//}
public void SelectDisplayTabItem(DisplayTabItem myDisplayTabItem)
{
if (myDisplayTabItem != null)
@@ -1094,11 +1069,10 @@ namespace Volian.Controls.Library
if (myBar == null) myBar = b;// Remember the first available bar if a specific bar cannot be found
foreach (object itm in b.Items)
{
DisplayTabItem myTabItem = itm as DisplayTabItem;
if (myTabItem != null && myTabItem.MyStepTabPanel != null && myItemInfo != null)
if (myTabItem.MyStepTabPanel.MyProcedureItemInfo.ItemID == myItemInfo.MyProcedure.ItemID)
return b;
}
if (itm is DisplayTabItem myTabItem && myTabItem.MyStepTabPanel != null && myItemInfo != null)
if (myTabItem.MyStepTabPanel.MyProcedureItemInfo.ItemID == myItemInfo.MyProcedure.ItemID)
return b;
}
}
}
if (myBar == null)
@@ -1107,7 +1081,7 @@ namespace Volian.Controls.Library
_UniqueBarCount++;
myBar = BarUtilities.CreateDocumentBar();
myBar.DockTabClosing += new DockTabClosingEventHandler(myBar_DockTabClosing);
myBar.Name = "barDocuments" + _UniqueBarCount.ToString();
myBar.Name = $"barDocuments{_UniqueBarCount}";
fillDocDockSite.GetDocumentUIManager().Dock(myBar);
SetupBar(myBar);
}
@@ -1123,11 +1097,10 @@ namespace Volian.Controls.Library
if (myBar == null) myBar = b;// Remember the first available bar if a specific bar cannot be found
foreach (object itm in b.Items)
{
DisplayTabItem myTabItem = itm as DisplayTabItem;
if (myTabItem != null && myTabItem.MyStepTabPanel != null && myTabItem.MyStepTabPanel.MyProcedureItemInfo != null)
if (myTabItem.MyStepTabPanel.MyProcedureItemInfo.ItemID == myItemInfo.MyProcedure.ItemID)
return myTabItem.MyStepTabPanel;
}
if (itm is DisplayTabItem myTabItem && myTabItem.MyStepTabPanel != null && myTabItem.MyStepTabPanel.MyProcedureItemInfo != null)
if (myTabItem.MyStepTabPanel.MyProcedureItemInfo.ItemID == myItemInfo.MyProcedure.ItemID)
return myTabItem.MyStepTabPanel;
}
}
}
return null;
@@ -1155,8 +1128,7 @@ namespace Volian.Controls.Library
if (stp != null)
{
EditItem ei = stp.SelectedEditItem;
if (ei != null)
ei.SaveCurrentAndContents();
ei?.SaveCurrentAndContents();
}
}
}
@@ -1164,41 +1136,17 @@ namespace Volian.Controls.Library
public DisplayTabItem GetProcDisplayTabItem(ItemInfo myItemInfo)
{
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
DisplayTabItem pg = null;
string key = $"Item - {proc.ItemID}";
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
return _MyDisplayTabItems[key];
return null;
}
/// <summary>
/// This opens a Step page based upon a ItemInfo.
///
/// </summary>
/// <param name="myItemInfo"></param>
/// <returns></returns>
//public bool IsItemInfoProcedureOpen(ItemInfo ii)
// if (ii == null) return false; //{
// ItemInfo proc = ii.MyProcedure; // Find procedure Item
// if (dicEnhancedDocuments.ContainsKey(ii.MyProcedure.MyDocVersion))
// {
// frmEnhanced frm = dicEnhancedDocuments[ii.MyProcedure.MyDocVersion];
// string key = "Item - " + proc.ItemID.ToString();
// if (frm.MyDisplayTabClntrol._MyDisplayTabItems.ContainsKey(key))
// return true;
// }
// // return true;
// //return false;
// return false;
//}
//public Dictionary<DocVersionInfo, frmEnhanced> dicEnhancedDocuments = new Dictionary<DocVersionInfo, frmEnhanced>();
private DisplayTabItem OpenStepTabPage(ItemInfo myItemInfo, bool setFocus, bool viewonlymode = false)
{
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
DisplayTabItem pg = null;
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
string key = $"Item - {proc.ItemID}";
DisplayTabItem pg;
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
{
pg = _MyDisplayTabItems[key];
if (setFocus)
@@ -1219,9 +1167,6 @@ namespace Volian.Controls.Library
HandleChangeId(myItemInfo, pg);
SelectDisplayTabItem(pg);
// If this is an enhanced document, check for refresh of text items:
//if (myItemInfo.IsProcedure)
//{
// make the myiteminfo into a procedureinfo (depending on where this is called from, just
// casting it crashed:
ProcedureInfo pi = ProcedureInfo.Get(myItemInfo.MyProcedure.ItemID);
@@ -1236,7 +1181,6 @@ namespace Volian.Controls.Library
pi.EnhancedProcedureRefreshTextDifferences(iil);
}
}
//}
}
pg.MyStepTabPanel.MyProcedureItemInfo = proc;
@@ -1251,11 +1195,6 @@ namespace Volian.Controls.Library
}
Application.DoEvents();
pg.SelectedItemInfo = myItemInfo; // Select the item
//StepConfig sc = new StepConfig(myItemInfo.MyContent.Config);
//if (sc.Step_SourceToBackground != null || sc.Step_SourceToDeviation != null)
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = true;
//else
// pg.MyStepTabPanel.MyStepTabRibbon.btnEnhancedDocSync.Visible = false;
return pg;
}
private bool _SyncEnhancedDocuments;
@@ -1276,7 +1215,7 @@ namespace Volian.Controls.Library
{
if (!Volian.Base.Library.VlnSettings.GetCommandFlag("NOCHGID"))
{
dlgChgId dlgCI = new dlgChgId(this); //, null);
dlgChgId dlgCI = new dlgChgId(this);
dlgCI.ShowDialog(this);
}
ItemsChangeIds.Add(myItemInfo.MyProcedure.ItemID, ChgId);
@@ -1285,11 +1224,6 @@ namespace Volian.Controls.Library
private void SetChangeId(string chgid, DisplayTabItem pg, ItemInfo ii)
{
//if (pg == null || pg.MyStepTabPanel == null)
//{
// ChgId = null;
// return;
//}
if (pg != null && pg.MyStepTabPanel != null) pg.MyStepTabPanel.MyStepTabRibbon.SetChangeId(chgid, ii);
ChgId = chgid;
}
@@ -1297,7 +1231,7 @@ namespace Volian.Controls.Library
private bool LibDocAlreadyOpen(ItemInfo myItemInfo)
{
EntryInfo myEntry = myItemInfo.MyContent.MyEntry;
string key = "Doc - " + myEntry.DocID;
string key = $"Doc - {myEntry.DocID}";
DisplayTabItem pg = null;
return LibDocAlreadyOpen(myItemInfo, key, ref pg, false);
}
@@ -1341,7 +1275,7 @@ namespace Volian.Controls.Library
{
DisplayTabItem pg = null;
EntryInfo myEntry = myItemInfo.MyContent.MyEntry;
string key = "Doc - " + myEntry.DocID;
string key = $"Doc - {myEntry.DocID}";
bool libDocAlreadyOpen = LibDocAlreadyOpen(myItemInfo, key, ref pg, true);
if (!libDocAlreadyOpen && pg == null)
{
@@ -1350,8 +1284,6 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
return null;
}
//if ((myItemInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "")
// MessageBox.Show("WARNING: All edits made to this Library Document will be applied to all uses of the Document");
pg = new DisplayTabItem(this.components, this, myItemInfo, key); // Open a new document page
// B2917-219 if MyEdWord is null that means we had trouble opening the word attachment and either a blank document was created or a previous version was recovered
// so we now we want to open the now blank or recovered attachment
@@ -1373,21 +1305,21 @@ namespace Volian.Controls.Library
{
_MyBar = GetParentBar(null); // B2016-131 - allow open of a non-referenced library document
CleanUpClosedItems();
DisplayTabItem pg = null;
string key = "Doc - " + myDocumentInfo.DocID;
if (_MyDisplayTabItems.ContainsKey(key)) // If document page open use it
pg = _MyDisplayTabItems[key];
else
{
if (DSOTabPanel.Count > DSOTabPanel.MSWordLimit) //18) // Limit the number of open document pages to 18
{
FlexibleMessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
return null;
}
pg = new DisplayTabItem(this.components, this, myDocumentInfo, key); // Open a new document page
_MyDisplayTabItems.Add(key, pg);
}
SelectDisplayTabItem(pg);
string key = $"Doc - {myDocumentInfo.DocID}";
DisplayTabItem pg;
if (_MyDisplayTabItems.ContainsKey(key)) // If document page open use it
pg = _MyDisplayTabItems[key];
else
{
if (DSOTabPanel.Count > DSOTabPanel.MSWordLimit) //18) // Limit the number of open document pages to 18
{
FlexibleMessageBox.Show("Too many Word Documents Open. Please close one of the Documents before attempting to open another");
return null;
}
pg = new DisplayTabItem(this.components, this, myDocumentInfo, key); // Open a new document page
_MyDisplayTabItems.Add(key, pg);
}
SelectDisplayTabItem(pg);
pg.MyDSOTabPanel.EnterPanel();
return pg;
}
@@ -1404,12 +1336,10 @@ namespace Volian.Controls.Library
_MyDisplayTabItems.Remove(myDisplayTabItem.MyKey);
// Dispose of the procedure tab panel
if (myDisplayTabItem.MyStepTabPanel != null)
myDisplayTabItem.MyStepTabPanel.Dispose();
myDisplayTabItem.MyStepTabPanel?.Dispose();
// Dispose of the MS Word Panel
if (myDisplayTabItem.MyDSOTabPanel != null)
myDisplayTabItem.MyDSOTabPanel.CloseDSO();
myDisplayTabItem.MyDSOTabPanel?.CloseDSO();
components.Remove(myDisplayTabItem);
myDisplayTabItem.Dispose();
+59 -142
View File
@@ -1,9 +1,5 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Drawing;
using VEPROMS.CSLA.Library;
using JR.Utils.GUI.Forms;
@@ -12,29 +8,21 @@ namespace Volian.Controls.Library
public partial class DisplayTabItem : DevComponents.DotNetBar.DockContainerItem
{
#region Private Fields
private DisplayTabControl _MyDisplayTabControl;
private ItemInfo _MyItemInfo;
private StepTabPanel _MyStepTabPanel;
private string _MyKey;
private DSOTabPanel _MyDSOTabPanel;
private DocumentInfo _MyDocumentInfo;
private readonly DisplayTabControl _MyDisplayTabControl;
private readonly ItemInfo _MyItemInfo;
private readonly string _MyKey;
private readonly DocumentInfo _MyDocumentInfo;
#endregion
#region Properties
/// <summary>
/// ItemInfo associated with this DisplayTabItem
/// </summary>
private int _OwnerID;
public int OwnerID
{
get { return _OwnerID; }
set { _OwnerID = value; }
}
public ItemInfo MyItemInfo
#endregion
#region Properties
/// <summary>
/// ItemInfo associated with this DisplayTabItem
/// </summary>
public int OwnerID { get; set; }
public ItemInfo MyItemInfo
{
get { return _MyItemInfo; }
//set { _MyItemInfo = value; }
}
/// <summary>
/// get Key Either:
@@ -45,48 +33,29 @@ namespace Volian.Controls.Library
{
get { return _MyKey; }
}
/// <summary>
/// Related StepTabPanel for a Step page
/// </summary>
public StepTabPanel MyStepTabPanel
{
get { return _MyStepTabPanel; }
set { _MyStepTabPanel = value; }
}
/// <summary>
/// Related DSOTabPanle for a Word page
/// </summary>
public DSOTabPanel MyDSOTabPanel
{
get { return _MyDSOTabPanel; }
set { _MyDSOTabPanel = value; }
}
private string _MyUserRole;
public string MyUserRole
{
get { return _MyUserRole; }
set { _MyUserRole = value; }
}
private bool _Closed = false;
public bool Closed
{
get { return _Closed; }
set { _Closed = value; }
}
/// <summary>
/// Current SelectedItemInfo for this page
/// </summary>
public ItemInfo SelectedItemInfo
/// <summary>
/// Related StepTabPanel for a Step page
/// </summary>
public StepTabPanel MyStepTabPanel { get; set; }
/// <summary>
/// Related DSOTabPanle for a Word page
/// </summary>
public DSOTabPanel MyDSOTabPanel { get; set; }
public string MyUserRole { get; set; }
/// <summary>
/// Current SelectedItemInfo for this page
/// </summary>
public ItemInfo SelectedItemInfo
{
get
{
if (_MyStepTabPanel == null) return null;
return _MyStepTabPanel.SelectedItemInfo;
if (MyStepTabPanel == null) return null;
return MyStepTabPanel.SelectedItemInfo;
}
set
{// B2018-074 Don't crash if opening MSWord section from Tools window in Debug Mode
if (_MyStepTabPanel != null)
_MyStepTabPanel.SelectedItemInfo = value;
if (MyStepTabPanel != null)
MyStepTabPanel.SelectedItemInfo = value;
}
}
/// <summary>
@@ -121,14 +90,6 @@ namespace Volian.Controls.Library
else
SetupDSOTabPanel();
SetupSecurity(myItemInfo);
// B2022-055 assigning the Name caused a duplicate name error
// we found that the procedure tab control remained in the Control list after the procedure was closed
// later on we need to find out why it isn't removed when the procedure is closed
//if (MyDSOTabPanel == null || MyDSOTabPanel.MyEdWord != null) // B2017-219 check needed if we could not open a word attachment
//{
// //Name = string.Format("DisplayTabItem {0}", myItemInfo.ItemID);
//}
}
private bool MesssageShown = false;
public void SetupSecurity(ItemInfo myItem)
@@ -172,43 +133,37 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("Security has not been defined for PROMS. All functionality has been defaulted to the lowest level for all users until security is defined.", "no security defined", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
MesssageShown = true;
}
_MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode();
MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode();
}
else if (ui.IsAdministrator())
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupAdminMode();
MyStepTabPanel?.MyStepTabRibbon.SetupAdminMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Administrator";
}
else if (ui.IsSetAdministrator(myItem.MyDocVersion))
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupSetAdminMode();
MyStepTabPanel?.MyStepTabRibbon.SetupSetAdminMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Set Administrator";
}
else if (ui.IsROEditor(myItem.MyDocVersion) && !ui.IsWriter(myItem.MyDocVersion))
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupROEditorMode();
MyStepTabPanel?.MyStepTabRibbon.SetupROEditorMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - RO Editor";
}
else if (ui.IsWriter(myItem.MyDocVersion))
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupWriterMode();
MyStepTabPanel?.MyStepTabRibbon.SetupWriterMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Writer";
}
else if (ui.IsReviewer(myItem.MyDocVersion))
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode();
MyStepTabPanel?.MyStepTabRibbon.SetupReviewerMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Reviewer";
}
else
{
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode();
MyStepTabPanel?.MyStepTabRibbon.SetupReviewerMode();
MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Reviewer";
}
}
@@ -222,42 +177,19 @@ namespace Volian.Controls.Library
InitializeComponent();
this.Click += new EventHandler(DisplayTabItem_Click);
SetupLibraryDocumentDSOTabPanel();
// B2022-055 assigning the Name caused a duplicate name error
// we found that the procedure tab control remained in the Control list after the procedure was closed
// later on we need to find out why it isn't removed when the procedure is closed
//Name = string.Format("DisplayTabLibraryDocument {0}", myDocumentInfo.DocID);
}
protected override void OnDisplayedChanged()
{
//Console.WriteLine("=>=>=>=> OnDisplayedChanged");
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepPanel.DisplayItemChanging = true;
if (MyStepTabPanel != null)
MyStepTabPanel.MyStepPanel.DisplayItemChanging = true;
base.OnDisplayedChanged();
if (_MyStepTabPanel != null)
_MyStepTabPanel.MyStepPanel.DisplayItemChanging = false;
if (MyStepTabPanel != null)
MyStepTabPanel.MyStepPanel.DisplayItemChanging = false;
//Console.WriteLine("<=<=<=<= OnDisplayedChanged");
}
//void DisplayTabItem_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
//{
// Console.WriteLine("DisplayTabItem_MouseUp");
//}
//void DisplayTabItem_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
//{
// Console.WriteLine("DisplayTabItem_MouseDown");
//}
//void DisplayTabItem_LostFocus(object sender, EventArgs e)
//{
// Console.WriteLine("DisplayTabItem_LostFocus");
//}
//void DisplayTabItem_GotFocus(object sender, EventArgs e)
//{
// Console.WriteLine("DisplayTabItem_GotFocus");
//}
#endregion
#region Event Handlers
/// <summary>
@@ -267,12 +199,10 @@ namespace Volian.Controls.Library
/// <param name="e"></param>
private void DisplayTabItem_Click(object sender, EventArgs e)
{
// Tell the TabControl that the ItemSelected has changed
DisplayTabItem myTabItem = sender as DisplayTabItem;
if (myTabItem == null) return;
StepTabPanel myTabPanel = myTabItem.MyStepTabPanel as StepTabPanel;
if (myTabPanel == null) return;
if (MyStepTabPanel.SelectedEditItem == null) return;
// Tell the TabControl that the ItemSelected has changed
if (!(sender is DisplayTabItem myTabItem)) return;
if (!(myTabItem.MyStepTabPanel is StepTabPanel)) return;
if (MyStepTabPanel.SelectedEditItem == null) return;
MyStepTabPanel.MyDisplayTabControl.HandleChangeId(MyStepTabPanel.SelectedEditItem.MyItemInfo, myTabItem);
_MyDisplayTabControl.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(MyStepTabPanel.SelectedEditItem));
}
@@ -285,33 +215,28 @@ namespace Volian.Controls.Library
{
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).BeginInit();
_MyDisplayTabControl.MyBar.SuspendLayout();
_MyStepTabPanel = new StepTabPanel(_MyDisplayTabControl);
MyStepTabPanel = new StepTabPanel(_MyDisplayTabControl);
//
// tabItem
//
Control = _MyStepTabPanel;
// B2022-055 assigning the Name caused a duplicate name error
// we found that the procedure tab control remained in the Control list after the procedure was closed
// later on we need to find out why it isn't removed when the procedure is closed
//Name = "tabItem Item " + _MyItemInfo.ItemID;
Control = MyStepTabPanel;
Text = _MyItemInfo.TabTitle;
_MyItemInfo.Changed += new ItemInfoEvent(_MyItemInfo_Changed);
Tooltip = _Tooltip = _MyItemInfo.TabToolTip.Replace("\u2011", "-").Replace(@"\u9586?", @"\");
MouseMove += new System.Windows.Forms.MouseEventHandler(DisplayTabItem_MouseMove);
LostFocus += new EventHandler(DisplayTabItem_LostFocus);
//
_MyDisplayTabControl.Controls.Add(_MyStepTabPanel);
_MyDisplayTabControl.Controls.Add(MyStepTabPanel);
_MyDisplayTabControl.MyBar.Items.Add(this);
_MyDisplayTabControl.MyBar.Width = 300; // This triggers the bar to resize itself
//
// tabPanel
//
_MyStepTabPanel.MyDisplayTabItem = this;
MyStepTabPanel.MyDisplayTabItem = this;
((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).EndInit();
_MyDisplayTabControl.MyBar.ResumeLayout(false);
DocVersionInfo dvi = _MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; //MyRTBItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
if (dvi == null) return;
if (dvi.VersionType > 127 || viewonlymode)
if (!(_MyItemInfo.MyProcedure.ActiveParent is DocVersionInfo dvi)) return;
if (dvi.VersionType > 127 || viewonlymode)
MyStepTabPanel.MyStepPanel.VwMode = E_ViewMode.View;
// C2021 - 027: Procedure level PC/PC - add _MyIteminfo to argument list
if (dvi.MultiUnitCount > 1)
@@ -345,21 +270,17 @@ namespace Volian.Controls.Library
{
EntryInfo myEntry = _MyItemInfo.MyContent.MyEntry;
UserInfo ui = UserInfo.GetByUserID(OwnerInfo.Get(OwnerID).SessionUserID);
_MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyDisplayTabControl, _MyItemInfo, UserInfo.CanEdit(ui, MyItemInfo.MyDocVersion));
if (_MyDSOTabPanel.MyEdWord == null) return; // B2017-219 if we could not open the word attachment just return
MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyDisplayTabControl, _MyItemInfo, UserInfo.CanEdit(ui, MyItemInfo.MyDocVersion));
if (MyDSOTabPanel.MyEdWord == null) return; // B2017-219 if we could not open the word attachment just return
//
// tabItem
//
Control = _MyDSOTabPanel;
// B2022-055 assigning the Name caused a duplicate name error
// we found that the procedure tab control remained in the Control list after the procedure was closed
// later on we need to find out why it isn't removed when the procedure is closed
//Name = "tabItem Item " + _MyItemInfo.ItemID;
Control = MyDSOTabPanel;
Text = _MyItemInfo.TabTitle;
Tooltip = _Tooltip = _MyItemInfo.TabToolTip.Replace("\u2011", "-").Replace(@"\u9586?", @"\");
MouseMove += new System.Windows.Forms.MouseEventHandler(DisplayTabItem_MouseMove);
LostFocus += new EventHandler(DisplayTabItem_LostFocus);
_MyDisplayTabControl.Controls.Add(_MyDSOTabPanel);
_MyDisplayTabControl.Controls.Add(MyDSOTabPanel);
DSOTabPanel.IgnoreEnter = true;
//Console.WriteLine("AddRange {0}", Name);
_MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
@@ -368,7 +289,7 @@ namespace Volian.Controls.Library
// tabPanel
//
_MyDisplayTabControl.SelectDisplayTabItem(this);
_MyDSOTabPanel.MyDisplayTabItem = this;
MyDSOTabPanel.MyDisplayTabItem = this;
DSOTabPanel.IgnoreEnter = false;
}
private void SetupLibraryDocumentDSOTabPanel()
@@ -377,21 +298,17 @@ namespace Volian.Controls.Library
// B2016-131 if myiteminfo is null, then the lib doc is not referenced.
// - Allow editting only if you are an Administrator
// - Cannot check if you are a Writer or Set Aministrator because we don't have a Doc Verion
_MyDSOTabPanel = new DSOTabPanel(_MyDocumentInfo, _MyDisplayTabControl, _MyItemInfo, (MyItemInfo != null) ? UserInfo.CanEdit(ui, MyItemInfo.MyDocVersion) : ui.IsAdministrator());
MyDSOTabPanel = new DSOTabPanel(_MyDocumentInfo, _MyDisplayTabControl, _MyItemInfo, (MyItemInfo != null) ? UserInfo.CanEdit(ui, MyItemInfo.MyDocVersion) : ui.IsAdministrator());
//
// tabItem
//
Control = _MyDSOTabPanel;
// B2022-055 assigning the Name caused a duplicate name error
// we found that the procedure tab control remained in the Control list after the procedure was closed
// later on we need to find out why it isn't removed when the procedure is closed
//Name = "tabLibraryDocument " + _MyDocumentInfo.DocID;
Control = MyDSOTabPanel;
Text = _MyDocumentInfo.LibTitle;
DocumentConfig dc = new DocumentConfig(_MyDocumentInfo);
Tooltip = _Tooltip = dc.LibDoc_Comment;
MouseMove += new System.Windows.Forms.MouseEventHandler(DisplayTabItem_MouseMove);
LostFocus += new EventHandler(DisplayTabItem_LostFocus);
_MyDisplayTabControl.Controls.Add(_MyDSOTabPanel);
_MyDisplayTabControl.Controls.Add(MyDSOTabPanel);
DSOTabPanel.IgnoreEnter = true;
_MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this});
@@ -399,7 +316,7 @@ namespace Volian.Controls.Library
// tabPanel
//
_MyDisplayTabControl.SelectDisplayTabItem(this);
_MyDSOTabPanel.MyDisplayTabItem = this;
MyDSOTabPanel.MyDisplayTabItem = this;
DSOTabPanel.IgnoreEnter = false;
}
#endregion
+4 -4
View File
@@ -215,7 +215,8 @@ namespace Volian.Controls.Library
this.groupPanelCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelCheckoff.Controls.Add(this.cmbCheckoff);
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelCheckoff.Controls.Add(this.cbInitialLine);
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelCheckoff.Dock = System.Windows.Forms.DockStyle.Top;
this.groupPanelCheckoff.Location = new System.Drawing.Point(0, 231);
this.groupPanelCheckoff.Margin = new System.Windows.Forms.Padding(2);
@@ -265,8 +266,7 @@ namespace Volian.Controls.Library
this.cbInitialLine.Margin = new System.Windows.Forms.Padding(2);
this.cbInitialLine.Name = "cbInitialLine";
this.cbInitialLine.Size = new System.Drawing.Size(112, 15);
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Manual Page Break", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: <Ctrl><Ente" +
"r>", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Disable Initial Line", "", "When set, The initial line will be removed from this step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbInitialLine.TabIndex = 1;
this.cbInitialLine.Text = "Disable Initial Line";
this.cbInitialLine.Visible = false;
@@ -276,7 +276,6 @@ namespace Volian.Controls.Library
//
this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine);
this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds);
this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top;
@@ -880,3 +879,4 @@ namespace Volian.Controls.Library
private System.Windows.Forms.Button btnSaveChangeID;
}
}
+63 -209
View File
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using JR.Utils.GUI.Forms;
@@ -13,18 +10,14 @@ namespace Volian.Controls.Library
{
public partial class DisplayTags : UserControl
{
#region Properties
private ItemInfo _CurItemInfo = null;
/// <summary>
/// Current ItemInfo
/// </summary>
public ItemInfo CurItemInfo
{
get { return _CurItemInfo; }
set { _CurItemInfo = value; }
}
private bool _Initalizing = false;
private IList<int> _MyStepTypeInd = null; // use to keep track of step types put in step type menu
#region Properties
/// <summary>
/// Current ItemInfo
/// </summary>
public ItemInfo CurItemInfo { get; set; } = null;
private bool _Initalizing = false;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private IList<int> _MyStepTypeInd = null; // use to keep track of step types put in step type menu
/// <summary>
/// This stores the last selected EditItem when the Panel was not visible
/// This allows the panel to be filled when the when it is made visible
@@ -70,23 +63,6 @@ namespace Volian.Controls.Library
CurItemInfo = value.MyItemInfo;
_MyEditItem.MyStepPropertiesPanel = this; // this allows us to access the Step Property pannel and toggle check boxes with shortcut keystrokes
// originally the change all (for step type) checkbox was initialized based
// on whether all steps at level were same type, i.e. if same type, default
// it to checked. This may confuse the user, so we decided to always default
// to not checked. The code was left in here in case that decision is changed.
// MRC, JSJ & KBR were in on discussion on 2/27/12:
// only change all at level if all substeps are of same type
//bool allSameType = true;
//ItemInfo itmp = CurItemInfo.FirstSibling;
//while (itmp != null)
//{
// if (CurItemInfo.MyContent.Type != itmp.MyContent.Type)
// {
// allSameType = false;
// break;
// }
// itmp = itmp.NextItem;
//}
cbChgAll.Checked = false;
TagsFillIn();
}
@@ -119,7 +95,6 @@ namespace Volian.Controls.Library
cbTCAS.Checked = false;
cbCAS.Enabled = false;
cbTCAS.Enabled = false;
//txbxAltConActSumText.Enabled = false;
rbChgBarOff.Enabled = false;
rbChgBarOn.Enabled = false;
listBoxStepTypes.Items.Clear();
@@ -134,21 +109,13 @@ namespace Volian.Controls.Library
}
private bool StepOverRide()
{
ItemInfo myparent = CurItemInfo.MyActiveParent as ItemInfo;
if (CurItemInfo.IsRNOPart && myparent !=null && myparent.IsHigh)
{
// does the high level step of an RNO have a checkoff, if so it
// can be overridden?
StepConfig sc = myparent.MyConfig as StepConfig;
if (sc != null && sc.Step_CheckOffIndex != -1) return true;
}
return false;
}
public void HighlightChangeStep()
{
// As per MRC - don't bother to color it.
// left here in case we change our mind.
//groupPanelChgStepType.Style.BackColor = Color.PaleVioletRed;
if (CurItemInfo.IsRNOPart && CurItemInfo.MyActiveParent is ItemInfo myparent && myparent.IsHigh)
{
// does the high level step of an RNO have a checkoff, if so it
// can be overridden?
if (myparent.MyConfig is StepConfig sc && sc.Step_CheckOffIndex != -1) return true;
}
return false;
}
public void FocusOnImageSize()
{
@@ -246,7 +213,8 @@ namespace Volian.Controls.Library
}
}
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
private void TagsFillIn()
{
_Initalizing = true;
@@ -289,7 +257,6 @@ namespace Volian.Controls.Library
{
cbPlaceKeeper.Enabled = cbPlaceKeeperCont.Enabled = false;
}
//cbCAS.Enabled = true;
rbChgBarOff.Enabled = true;
rbChgBarOn.Enabled = true;
@@ -303,7 +270,6 @@ namespace Volian.Controls.Library
if (cmbShwRplWds.Visible)
{
cmbShwRplWds.SelectedIndex = 0;
//StepConfig sc = CurItemInfo.MyConfig as StepConfig;
cmbShwRplWds.Enabled = true;
cmbShwRplWds.SelectedIndex = sc.Step_ShwRplWdsIndex;
}
@@ -350,12 +316,6 @@ namespace Volian.Controls.Library
cbCAS.Checked = (sc.Step_CAS != null) ? sc.Step_CAS == "True" : CurItemInfo.IncludeOnContActSum;
// Set the Time Critical Action Summary check box - if nothing in config set to false
cbTCAS.Checked = (sc.Step_TCAS != null) ? sc.Step_TCAS == "True" : CurItemInfo.IncludeOnTimeCriticalActionSum;
//// if alternative continuous action text is saved in the config, then show it and check the checkbox
//if (sc.Step_AlternateContActSumText != null && sc.Step_AlternateContActSumText != "")
//{
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// cbCAS.Checked = true;
//}
}
bool _checkoffsAllowed = true;
if (fmtdata.ProcData.CheckOffData.CheckoffOnSubStepsOnly)
@@ -365,7 +325,7 @@ namespace Volian.Controls.Library
if (_checkoffsAllowed && !(fmtdata.ProcData.CheckOffData.CheckOffList == null) && !(maxindx == 0))
{
CheckOffList chkoffList = fmtdata.ProcData.CheckOffData.CheckOffList;
if (chkoffList != null) chkoffList.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
chkoffList?.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
cmbCheckoff.Items.Clear();
_CheckOffIndex.Clear(); // C2020-003 clear the checkoff index dictionary
int sortedIndx = 0;
@@ -423,15 +383,6 @@ namespace Volian.Controls.Library
tbFSWd.Text = wd.ToString();
tbFSHt.Text = ht.ToString();
//trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
//if (wd > trBarFS.Maximum) trBarFS.Maximum = wd + 1;
//trBarFS.Minimum = Math.Min(wd, 72);
//trBarFS.Value = (int)wd;
//ImageItem ii = MyEditItem as ImageItem;
//_origFigureSizeWidth = ii.MyPictureBox.Width;
//tbFSWd.Text = ii.MyPictureBox.Width.ToString();
//tbFSHt.Text = ii.MyPictureBox.Height.ToString();
}
else
{
@@ -458,11 +409,6 @@ namespace Volian.Controls.Library
// There is also an override flag in the config for the step, used to override the change bar to 'off'
// if the date show it as having one, or allow a change bar to be 'on' if there the dates are
// not different. Note also that a user may edit data after the change bar is set to 'on'.
//DateTime curDts;
//using (Item itm = Item.Get(CurItemInfo.ItemID))
//{
// curDts = itm.DTS;
//}
// set change bar radio buttons for the default that there is no change
// bar & override sets it to On.
@@ -486,24 +432,13 @@ namespace Volian.Controls.Library
}
else
{
rbChgBarOff.Checked = (sc.Step_CBOverride == "Off") ? true : false;
rbChgBarOn.Checked = (sc.Step_CBOverride == "On") ? true : false;
rbChgBarOff.Checked = (sc.Step_CBOverride == "Off");
rbChgBarOn.Checked = (sc.Step_CBOverride == "On");
// there is override settings in the config... If the date time stamp says that text was changed
// so a change bar should exist - check override to see how change bar controls are set:
// If the date of this is greater than the procedure, a change bar should be displayed -
// see what the override says. The override states whether change bar is on/off (not
// whether override is on/off)
//if (curDts > CurItemInfo.MyProcedure.DTS)
//{
// rbChgBarOff.Text = "OFF (Override)";
// rbChgBarOn.Text = "ON";
//}
//else
//{
// // date time stamp says no change bar should be displayed:
// rbChgBarOff.Text = "OFF";
// rbChgBarOn.Text = "ON (Override)";
//}
}
// see if the change id label & text box are visible, i.e. plant has multiple change ids.
@@ -575,18 +510,15 @@ namespace Volian.Controls.Library
}
public void SetFigure(double wd, double wd2)
{
// Check MyEditItem type and cast if needed
ImageItem ii = MyEditItem as ImageItem;
if (ii == null) return;
// Check MyEditItem type and cast if needed
if (!(MyEditItem is ImageItem ii)) return;
// Set the values as needed
trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
// Set the values as needed
trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
if (wd > trBarFS.Maximum) trBarFS.Maximum = (int)wd + 1;
trBarFS.Minimum = Math.Min((int)wd, 72);
trBarFS.Value = (int)wd;
_origFigureSizeWidth = ii.MyPictureBox.Width;
//tbFSWd.Text = ii.MyPictureBox.Width.ToString();
//tbFSHt.Text = ii.MyPictureBox.Height.ToString();
}
private int DoListStepTypes(FormatData fmtdata, StepData topType, string curType)
@@ -611,27 +543,14 @@ namespace Volian.Controls.Library
}
return cursel;
}
//private void AddToGallery(StepData sd, string curType)
//{
// DevComponents.DotNetBar.ButtonItem bi = new DevComponents.DotNetBar.ButtonItem("btn" + sd.Type, sd.Type);
// bi.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
// bi.Image = this.imageListStepTypes.Images[0];
// bi.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
// bi.Checked = (sd.Type == curType);
// galleryContainerStepTypes.SubItems.Add(bi);
// listBoxStepTypes.Items.Add(sd.Type);
//}
#endregion
#region Events
private void cbPageBreak_CheckedChanged(object sender, EventArgs e)
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (CurItemInfo.IsHigh)
sc.Step_NewManualPagebreak = cbPageBreak.Checked;
else // C2023-018: allow for sub-step page breaks
@@ -642,9 +561,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_CAS = (cbCAS.Checked) ? "True" : "False";
MyEditItem.ChangeBarForConfigItemChange = true;
// C2026-003 (put in for Vogtle 3&4) refresh the RNO step tab if including it on the Continuous Action Summary
@@ -656,9 +574,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_TCAS = (cbTCAS.Checked) ? "True" : "False";
MyEditItem.ChangeBarForConfigItemChange = true;
}
@@ -666,9 +583,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_Placekeeper = (cbPlaceKeeper.Checked) ? "Y" : "N";
MyEditItem.ChangeBarForConfigItemChange = true;
if (cbPlaceKeeper.Checked)
@@ -682,9 +598,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_Placekeeper = (cbPlaceKeeperCont.Checked) ? "C" : "N";
MyEditItem.ChangeBarForConfigItemChange = true;
if (cbPlaceKeeperCont.Checked)
@@ -698,9 +613,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_IncludeInTOC = cbIncludeInTOC.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
@@ -716,8 +630,8 @@ namespace Volian.Controls.Library
EditItem topEditItem = MyEditItem;
MyEditItem.SaveContents();
FormatData fmtdata = CurItemInfo.ActiveFormat.PlantFormat.FormatData;
string msgBox = null;
if (cbChgAll.Checked)
string msgBox;
if (cbChgAll.Checked)
{
ItemInfo startitm = CurItemInfo.FirstSibling;
topEditItem = MyEditItem.MyStepPanel._LookupEditItems[startitm.ItemID];
@@ -733,12 +647,6 @@ namespace Volian.Controls.Library
}
// B2018-120: if caution/note steps have enhanced - change their type too
if (startitm.IsNote || startitm.IsCaution) chgEnh = ChangeTypesEnhanced(startitm);
//using (Item itm = Item.Get(startitm.ItemID))
//{
// itm.DTS = DateTime.Now;
// itm.UserID = Volian.Base.Library.VlnSettings.UserID;
// itm.Save();
//}
startitm = startitm.GetNext();
}
msgBox = chgEnh ? string.Format("All Step Types at this level and associated enhanced steps were changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]) :
@@ -757,17 +665,9 @@ namespace Volian.Controls.Library
bool chgEnh = false;
// B2018-120: if caution/note steps have enhanced - change their type too
if (CurItemInfo.IsNote || CurItemInfo.IsCaution) chgEnh = ChangeTypesEnhanced(CurItemInfo);
//using (Item itm1 = Item.Get(CurItemInfo.ItemID))
//{
// itm1.DTS = DateTime.Now;
// itm1.UserID = Volian.Base.Library.VlnSettings.UserID;
// itm1.Save();
//}
msgBox = chgEnh ? string.Format("This Step Type and associated enhanced step were changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]):
string.Format("This Step Type was changed to {0}", listBoxStepTypes.Items[listBoxStepTypes.SelectedIndex]);
}
// the follow line was to try and fix a refresh problem when you change the type of a new substep
//topEditItem.MyStepPanel.Reset();
topEditItem.SetAllTabs();
FlexibleMessageBox.Show(msgBox);
@@ -821,12 +721,6 @@ namespace Volian.Controls.Library
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = CurItemInfo.HasChanges ? null : "On";
//using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
//{
// cnt.DTS = DateTime.Now;
// cnt.UserID = Volian.Base.Library.VlnSettings.UserID;
// cnt.Save();
//}
}
}
private void rbChgBarOvrRideOff_CheckedChanged(object sender, EventArgs e)
@@ -840,12 +734,6 @@ namespace Volian.Controls.Library
{
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CBOverride = CurItemInfo.HasChanges ? "Off" :null;
//using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
//{
// cnt.DTS = CurItemInfo.MyProcedure.DTS;
// cnt.UserID = CurItemInfo.MyProcedure.UserID;
// cnt.Save();
//}
}
}
private void cmbCheckoff_SelectedIndexChanged(object sender, EventArgs e)
@@ -856,25 +744,14 @@ namespace Volian.Controls.Library
int indx = _CheckOffIndex[cmbCheckoff.SelectedIndex]; // C2020-003 get the non-sorted index from the sorted index
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
sc.Step_CheckOffIndex = indx;
//using (Content cnt = Content.Get(CurItemInfo.MyContent.ContentID))
//{
// cnt.DTS = CurItemInfo.MyProcedure.DTS;
// cnt.UserID = CurItemInfo.MyProcedure.UserID;
// cnt.Save();
//}
}
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
private void cmbShwRplWds_SelectedIndexChanged(object sender, EventArgs e) // new show replace words
{
// --------
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
//sc.Step_DisableInitialLine = cbInitialLine.Checked;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_ShwRplWdsIndex = cmbShwRplWds.SelectedIndex;
MyEditItem.ChangeBarForConfigItemChange = true;
@@ -890,11 +767,10 @@ namespace Volian.Controls.Library
// off of the High Level Step
private void tbRespons_Leave(object sender, EventArgs e)
{
// User left responsibilty field. If text changed, then prompt
// to see if save should occur.
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
bool bothEmpty = (sc.Step_Responsibility == null || sc.Step_Responsibility == "") && (tbRespons.Text == null || tbRespons.Text == "");
// User left responsibilty field. If text changed, then prompt
// to see if save should occur.
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
bool bothEmpty = (sc.Step_Responsibility == null || sc.Step_Responsibility == "") && (tbRespons.Text == null || tbRespons.Text == "");
if (!bothEmpty && sc.Step_Responsibility != tbRespons.Text)
{
if (FlexibleMessageBox.Show(this, "Do you want to save the Responsibility Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
@@ -917,19 +793,19 @@ namespace Volian.Controls.Library
{
if (MyEditItem is ImageItem)
{
int wd = 0;
int ht = 0;
try
{
wd = int.Parse(tbFSWd.Text);
ht = int.Parse(tbFSHt.Text);
}
catch (Exception ex)
{
wd = 0;
ht = 0;
}
if (wd != 0 && ht != 0) (MyEditItem as ImageItem).SizeImage(wd, ht);
int wd;
int ht;
try
{
wd = int.Parse(tbFSWd.Text);
ht = int.Parse(tbFSHt.Text);
}
catch (Exception)
{
wd = 0;
ht = 0;
}
if (wd != 0 && ht != 0) (MyEditItem as ImageItem).SizeImage(wd, ht);
}
}
private float _origFigureSizeRatio = 0; // keep original ratio & width in case of 'restore'
@@ -966,8 +842,8 @@ namespace Volian.Controls.Library
{
newHt = int.Parse(tbFSWd.Text);
}
catch (Exception ex)
{
catch (Exception)
{
invaliddata = true;
}
if (invaliddata || newHt < trBarFS.Minimum || newHt > trBarFS.Maximum)
@@ -984,9 +860,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_PreferredPagebreak = cbPrefPageBreak.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
}
@@ -995,9 +870,8 @@ namespace Volian.Controls.Library
{
if (_Initalizing) return;
MyEditItem.SaveContents();
StepConfig sc = CurItemInfo.MyConfig as StepConfig;
if (sc == null) return;
MyEditItem.ChangeBarForConfigItemChange = false;
if (!(CurItemInfo.MyConfig is StepConfig sc)) return;
MyEditItem.ChangeBarForConfigItemChange = false;
sc.Step_DisableInitialLine = cbInitialLine.Checked;
MyEditItem.ChangeBarForConfigItemChange = true;
@@ -1023,25 +897,5 @@ namespace Volian.Controls.Library
}
}
//private void txbxAltConActSumText_Leave(object sender, EventArgs e)
//{
// // User left Atlernate Continuous Action Text field. If text changed, then prompt
// // to see if save should occur.
// StepConfig sc = CurItemInfo.MyConfig as StepConfig;
// if (sc == null) return;
// bool bothEmpty = (sc.Step_AlternateContActSumText == null || sc.Step_AlternateContActSumText == "") && (txbxAltConActSumText.Text == null || txbxAltConActSumText.Text == "");
// if (!bothEmpty && sc.Step_AlternateContActSumText != txbxAltConActSumText.Text)
// {
// if (MessageBox.Show(this, "Do you want to save the Alternate Continuous Action Text?", "Confirm Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
// {
// MyEditItem.SaveContents();
// sc.Step_AlternateContActSumText = txbxAltConActSumText.Text; // this actually saves the config
// }
// else
// txbxAltConActSumText.Text = sc.Step_AlternateContActSumText;
// }
//}
}
}
@@ -1,16 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using AT.STO.UI.Win;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using JR.Utils.GUI.Forms;
using System.Linq;
namespace Volian.Controls.Library
{
@@ -116,15 +113,9 @@ namespace Volian.Controls.Library
private bool _DoingRange = false; // flags if in 'range' transition mode
private VETreeNode _RangeNode1;
private VETreeNode _RangeNode2;
// Use _RangeColor to show highlighting for steps selected in range. This is set from
// calling methods from application settings. If not default to aquamarine.
private Color _RangeColor = Color.LightGray;
public Color RangeColor
{
get { return _RangeColor; }
set { _RangeColor = value; }
}
private StepRTB _MyRTB; // Current MyDisplayRTB, i.e. insert transition to it.
public Color RangeColor { get; set; } = Color.LightGray;
private StepRTB _MyRTB; // Current MyDisplayRTB, i.e. insert transition to it.
public StepRTB MyRTB
{
get { return _MyRTB; }
@@ -148,7 +139,6 @@ namespace Volian.Controls.Library
CurTrans = args.MyLinkText.MyTransitionInfo;
}
private ItemInfo _CurrentItemProcedure; // the selected item's procedure
private ItemInfo _CurrentToProcedure; // the 'to' location's procedure (may be same as _CurrentItemProcedure)
private ItemInfo _CurrentProcedure; // current procedure used to set all of the controls (may switch between above two)
private int _CurrentProcIndex;
private bool _AlwaysDisableSets; // true if there is only 1 item in tree/combo for sets
@@ -219,7 +209,6 @@ namespace Volian.Controls.Library
}
}
_CurrentProcedure = tmpitm;
_CurrentToProcedure = _CurrentProcedure;
if (_CurTrans == null)
_CurrentItemProcedure = _CurrentProcedure;
else
@@ -271,7 +260,6 @@ namespace Volian.Controls.Library
else if (secitm != null && secitm.Steps != null && secitm.Steps.Count > 0)
stpitm = selitm.Steps[0];
if (!_DoingRange) tvTranFillIn(stpitm); // range code fills in tree.
//if (_DoingRange) tvInitHiliteRange(rangeSameLevel, stpitm, rngitm, (i1 < i2) ? i2 : i1);
}
else
{
@@ -283,16 +271,13 @@ namespace Volian.Controls.Library
}
private void tvInitHiliteRange() //bool rangeSameLevel, ItemInfo stpitm, ItemInfo rngitm, int uplevel)
{
ItemInfo toItm = _CurTrans.MyItemToID;
ItemInfo rngItm = null;
// figure out whether at same level, have same parent and have same HLS:
ItemInfo itm1 = _CurTrans.MyItemToID;
_ = _CurTrans.MyItemToID;
// figure out whether at same level, have same parent and have same HLS:
ItemInfo itm1 = _CurTrans.MyItemToID;
ItemInfo itm2 = _CurTrans.MyItemRangeID;
// Invalid existing transition
if (itm2.ActiveParent == null || itm1.ActiveParent == null)
return;
//if (_CurTrans.TranType == 2 && itm1.ItemID == itm2.ItemID) itm2 = itm1.LastSibling;
bool samHLS = itm1.MyHLS.ItemID == itm2.MyHLS.ItemID;
int lev1 = 0;
int lev2 = 0;
while (!itm1.IsHigh)
@@ -305,7 +290,6 @@ namespace Volian.Controls.Library
lev2++;
itm2 = itm2.MyParent;
}
bool samLevel = lev1 == lev2;
// For each range item, go to common level's parent.
int cnt = lev1+1;
ItemInfo sameParent1 = _CurTrans.MyItemToID;
@@ -327,7 +311,7 @@ namespace Volian.Controls.Library
// now add nodes for the subtrees so that highlighting can be done. Do 'to' item
// first. If 'range' item is at same level, won't need to do anymore processing.
ItemInfo toItem = sameParent1.Ordinal<=sameParent2.Ordinal?_CurTrans.MyItemToID:_CurTrans.MyItemRangeID;
ItemInfo rngItem = null;
ItemInfo rngItem;
if (_CurTrans.TranType == 2 && _CurTrans.MyItemToID == _CurTrans.MyItemRangeID)
{
@@ -452,51 +436,6 @@ namespace Volian.Controls.Library
vlnTreeComboSets.DropDownControl.SelectedNode = topnode;
vlnTreeComboSets.DropDownControl.BeforeExpand += new TreeViewCancelEventHandler(vlnTreeComboSets_BeforeExpand);
#region CheckIfNeeded Commented Out
//vlnTreeComboSets.DropDownControl. = vlnTreeComboSets.Width;
// The DropDownNode should be at a DocVersion now. The expanded DocVersion
// is the one that matches mydocversion
//tmpfi = mydocversion.ActiveParent as FolderInfo;
//DocVersionInfoList dvlist = tmpfi.FolderDocVersions;
//DropDownNode tnDV = null;
// Once at a docversions, only allow working
// draft sets. Use DocVersion that we're in, to expand it showing the active procedure.
// first count how many versions can be displayed, i.e. only workingdraft?
// if more than one, put out a tree node for them.
//int cntdocv = 0;
//foreach (DocVersionInfo dv in dvlist)
//{
// if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft) cntdocv++;
//}
//if (cntdocv>1)
//{
// foreach (DocVersionInfo dv in dvlist)
// {
// if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft)
// {
// DropDownNode tn = new DropDownNode(dv.VersionID, dv.ToString());
// tn.Tag = dv;
// if (topnode != null)
// topnode.Nodes.Add(tn);
// else
// vlnTreeComboSets.DropDownControl.Nodes.Add(tn);
// if (dv.VersionID == mydocversion.VersionID)
// {
// tnDV = tn;
// vlnTreeComboSets.Value = tnDV;
// vlnTreeComboSets.DropDownControl.SelectedNode = tnDV;
// }
// //else if (dv.HasChildren) // allow for '+' for tree expansion
// //{
// // DropDownNode tnt = new DropDownNode(0,"VLN_DUMMY");
// // tn.Nodes.Add(tnt);
// //}
// }
// }
//}
#endregion
}
private void ListBoxTranFmtFillIn()
{
@@ -504,7 +443,7 @@ namespace Volian.Controls.Library
listBoxTranFmt.Items.Clear();
for (int i = 0; i < ttl.MaxIndex; i++)
listBoxTranFmt.Items.Add(new TransItem(ttl[i].TransMenu.Replace("?.",""),ttl[i].TransFormat.Replace("?.","")));
//listBoxTranFmt.Items.Add(ttl[i].TransFormat.Replace("?.",""));
listBoxTranFmt.SelectedIndex = _TranFmtIndx;
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
_DoingRange = (etm & E_TransUI.StepLast) == E_TransUI.StepLast;
@@ -532,18 +471,8 @@ namespace Volian.Controls.Library
if (startitm.MyContent.Type < 20000) return;
groupPanelTranstionSteps.Style.BackColor = Color.Cornsilk;
// For the tree view, use parent, unless already at HLS. If at HLS, use this level.
//ItemInfo selitm2 = startitm.MyHLS;
ItemInfo selSubSec = secitm.Sections[0];
// The commented out code below is for displaying the steps from the first sub-section B2025-035
//ItemInfo subSelStep = selSubSec.Steps[0];
//E_TransUI etm2 = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
//if (subSelStep.IsInRNO)
// startitm = subSelStep.FirstSibling; // if in RNO tree, start out with HLS
//else
// startitm = subSelStep != null ? subSelStep.FirstSibling : startitm.FirstSibling;
// B2025-035
ItemInfo subSelStep = secitm.Sections[0];
E_TransUI etm2 = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
if (subSelStep.IsInRNO)
@@ -551,13 +480,14 @@ namespace Volian.Controls.Library
else
startitm = subSelStep != null ? subSelStep.FirstSibling : startitm.FirstSibling;
// B2025-035
bool setsel2 = false;
while (startitm != null)
{
VETreeNode tvn = new VETreeNode(startitm, false);
tvn.Tag = startitm;
int active = this.tvTran.Nodes.Add(tvn);
VETreeNode tvn = new VETreeNode(startitm, false)
{
Tag = startitm
};
int active = this.tvTran.Nodes.Add(tvn);
if (subSelStep != null && startitm.ItemID == subSelStep.ItemID)
{
tvTran.SelectedNode = tvTran.Nodes[active];
@@ -580,7 +510,6 @@ namespace Volian.Controls.Library
groupPanelTranstionSteps.Style.BackColor = Color.Cornsilk;
// For the tree view, use parent, unless already at HLS. If at HLS, use this level.
ItemInfo selitm = startitm.MyHLS;
//if (_CurTrans == null)selitm = startitm.MyHLS;
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
if (startitm.IsInRNO)
startitm = selitm.FirstSibling; // if in RNO tree, start out with HLS
@@ -589,9 +518,11 @@ namespace Volian.Controls.Library
bool setsel = false;
while (startitm != null)
{
VETreeNode tvn = new VETreeNode(startitm, false);
tvn.Tag = startitm;
int active = this.tvTran.Nodes.Add(tvn);
VETreeNode tvn = new VETreeNode(startitm, false)
{
Tag = startitm
};
int active = this.tvTran.Nodes.Add(tvn);
if (selitm !=null && startitm.ItemID == selitm.ItemID)
{
tvTran.SelectedNode = tvTran.Nodes[active];
@@ -614,10 +545,8 @@ namespace Volian.Controls.Library
if (secitm == null || secitm.MyContent.Type < 10000) return;
// if sectstart is not -1, then use this as the section to select, otherwise
// use the id for the item passed in.
int startitm = secstart;
if (clear && secstart < 0) secstart = secitm.ItemID;
ItemInfo selitm = secitm; // this is the selected 'section'
secitm = secitm.FirstSibling;
secitm = secitm.FirstSibling;
while (secitm != null)
{
// if the selected transition format requires a step be selected (show only step sections), only add step sections
@@ -793,19 +722,6 @@ namespace Volian.Controls.Library
}
}
}
// B2018-009 Eliminate Working Draft (DocVersions) from the procedure tree for transitions
//else if (fi.FolderDocVersionCount > 0)
//{
// foreach (DocVersionInfo dv in fi.FolderDocVersions)
// {
// if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft)
// {
// DropDownNode newnode = new DropDownNode(dv.VersionID, dv.ToString());
// newnode.Tag = dv;
// par.Nodes.Add(newnode);
// }
// }
//}
}
vlnTreeComboSets.Value = par;
vlnTreeComboSets.DropDownControl.SelectedNode = par;
@@ -821,9 +737,9 @@ namespace Volian.Controls.Library
// selected the docversion itself....
bool defines_set = false;
FolderInfo fi = null;
if (obj is FolderInfo)
if (obj is FolderInfo finfo)
{
fi = (FolderInfo)obj;
fi = finfo;
if (fi.ChildFolderCount == 0)
{
// note that the folder may contain more than one docversion, check for
@@ -955,16 +871,6 @@ namespace Volian.Controls.Library
if (_DoingRange) tvTran.SelectedNode = null;
SaveCancelEnabling();
}
//private void btnUp1_Click(object sender, EventArgs e)
//{
// // if StepAllowNone, then use the second node in the tree view.
// int indx = 0;
// if (tvTran.Nodes[0].Tag == null) indx = 1;
// // if at HLS, don't do anything.
// ItemInfo curitm = (ItemInfo)((VETreeNode)tvTran.Nodes[indx]).VEObject;
// if (curitm.IsHigh) return;
// tvTranFillIn(curitm);
//}
private void tvTran_BeforeExpand(object sender, TreeViewCancelEventArgs e)
{
VETreeNode tn = ((VETreeNode)e.Node);
@@ -985,19 +891,15 @@ namespace Volian.Controls.Library
// it & disable.
ItemInfo secitm = (ItemInfo)cbTranSects.SelectedItem;
//if (secitm.IsStepSection)
//{
// cbTranSects.SelectedItem.Sections[0];
//}
if (!secitm.IsStepSection)
if (!secitm.IsStepSection)
{
tvTran.Nodes.Clear();
tvTran.Enabled = false;
cbIncStepNum.Enabled = false; // C2020-028: disable/uncheck 'Include Step Number' if on Word doc
cbIncStepNum.Checked = false;
// Set Save & Cancel enabling, depending on whether section can be an endpoint.
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
//Following line is for Debugging
//E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[_TranFmtIndx].TransUI;
SaveCancelEnabling();
}
else
@@ -1065,7 +967,7 @@ namespace Volian.Controls.Library
// 1) Look in ProcedureConfig/SectionStart
ProcedureConfig pc = (ProcedureConfig)prcitm.MyConfig;
int sectstartid = -1;
string ss = pc == null ? null : pc.SectionStart;
string ss = pc?.SectionStart;
SectionInfo si = null;
if (ss != null && ss != "")
{
@@ -1077,7 +979,7 @@ namespace Volian.Controls.Library
if (si.MyProcedure.ItemID == prcitm.ItemID) return sectstartid;
// The following code fixes the sectionstart property for the Copy Procedure function. This code will correct
// any procedures that were copied prior to the implementation of this the copy procedure function fix.
foreach (SectionInfo si1 in prcitm.Sections)
foreach (SectionInfo si1 in prcitm.Sections.OfType<SectionInfo>())
{
if (si.DisplayNumber == si1.DisplayNumber && si.DisplayText == si1.DisplayText)
{
@@ -1096,22 +998,21 @@ namespace Volian.Controls.Library
// 2) Look in SectionConfig/OriginalSteps = 'Y'
if (prcitm.Sections != null)
{
foreach (SectionInfo sio in prcitm.Sections)
foreach (SectionInfo sio in prcitm.Sections.OfType<SectionInfo>())
{
SectionConfig sc = sio.MyConfig as SectionConfig;
if (sc != null && sc.Section_OriginalSteps == "Y")
{
return sio.ItemID;
}
}
if (sio.MyConfig is SectionConfig sc && sc.Section_OriginalSteps == "Y")
{
return sio.ItemID;
}
}
// 3) Find if any of the section titles contain 'PROCEDURES STEPS'
foreach (SectionInfo sit in prcitm.Sections)
foreach (SectionInfo sit in prcitm.Sections.OfType<SectionInfo>())
{
if (sit.DisplayText.ToUpper().Contains("PROCEDURE STEPS"))
return sit.ItemID;
}
foreach (SectionInfo sit in prcitm.Sections)
foreach (SectionInfo sit in prcitm.Sections.OfType<SectionInfo>())
{
if (sit.DisplayText.ToUpper().Equals("PROCEDURE"))// bug fix: B2015-003
return sit.ItemID;
@@ -1120,17 +1021,17 @@ namespace Volian.Controls.Library
// 4) Format has flag that a default section is not required so return 1st section.
if (prcitm.Sections != null)
{
foreach (SectionInfo sid in prcitm.Sections)
foreach (SectionInfo sid in prcitm.Sections.OfType<SectionInfo>())
{
if (sid.IsStepSection && sid.ActiveFormat.PlantFormat.FormatData.TransData.NoDefaultSectReq) return sid.ItemID;
}
// 3) Find if any of the section titles contain 'PROCEDURES STEPS'
foreach (SectionInfo sit in prcitm.Sections)
foreach (SectionInfo sit in prcitm.Sections.OfType<SectionInfo>())
{
if (sit.DisplayText.ToUpper().Contains("PROCEDURE STEPS"))
return sit.ItemID;
}
foreach (SectionInfo sit in prcitm.Sections)
foreach (SectionInfo sit in prcitm.Sections.OfType<SectionInfo>())
{
if (sit.DisplayText.ToUpper().Equals("PROCEDURE"))// bug fix: B2015-003
return sit.ItemID;
@@ -1173,13 +1074,12 @@ namespace Volian.Controls.Library
// check if node is a true end-point, i.e. not a 'part' node. If part node, don't
// allow selection.
VETreeNode vt = tvTran.SelectedNode as VETreeNode;
ItemInfo selii = vt.VEObject as ItemInfo;
if (selii == null)
{
FlexibleMessageBox.Show("Must select a valid step, not a grouping part such as 'RNO', 'Steps', etc");
return;
}
SaveCancelEnabling();
if (!(vt.VEObject is ItemInfo selii))
{
FlexibleMessageBox.Show("Must select a valid step, not a grouping part such as 'RNO', 'Steps', etc");
return;
}
SaveCancelEnabling();
//CSM-C2024-026 Evaluate the transitions panel
//Create a way to keep it from reverting the transition display panel to the currently selected item/transition.
@@ -1197,7 +1097,7 @@ namespace Volian.Controls.Library
if (_RangeNode1 == null || (_RangeNode1 != null && _RangeNode2 != null))
{
if (_RangeNode1 != null) tvTranRangeHilites(false, _RangeNode1, _RangeNode2);
tvTran.SelectedNode.BackColor = _RangeColor;
tvTran.SelectedNode.BackColor = RangeColor;
_RangeNode1 = (VETreeNode)tvTran.SelectedNode;
_RangeNode2 = null;
lblxTranRangeTip.Text = "Select Last Step \r\nfor Range";
@@ -1208,7 +1108,7 @@ namespace Volian.Controls.Library
{
if (_RangeNode2 != null) tvTranRangeHilites(false, _RangeNode1, _RangeNode2);
_RangeNode2 = (VETreeNode)tvTran.SelectedNode;
tvTran.SelectedNode.BackColor = _RangeColor;
tvTran.SelectedNode.BackColor = RangeColor;
tvTranRangeHilites(true, _RangeNode1, _RangeNode2);
lblxTranRangeTip.Text = "Select First Transition\r\nfor Range";
lblxTranRangeTip.BackColor = Color.Yellow;
@@ -1219,8 +1119,6 @@ namespace Volian.Controls.Library
}
private void SaveCancelEnabling()
{
//bool hasChanged = _CurItemFrom != _SavCurItemFrom || _TranFmtIndx != _SavTranFmtIndx
// || ( selii != null && _CurTrans.ToID != selii.ItemID);
bool hasChanged = SettingsChanged;
bool isenh = MyRTB != null && MyRTB.MyItemInfo != null && MyRTB.MyItemInfo.IsEnhancedStep;
// B2018-002 - Invalid Transitions - Set button enabled if it has a default section or it doesn't need a default
@@ -1240,25 +1138,6 @@ namespace Volian.Controls.Library
null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
// B2024-007 color of transition panel was not toggling properly
groupPanelTranFmt.Style.BackColor = !HasDefault && NeedsDefault ? Color.Red : Color.Orange;
//btnTranSave.Enabled = allowSave;
//if (CurTrans != null && selii != null)
//{
// if (CurTrans.ToID == selii.ItemID)
// {
// // if the checkbox for including a page number (UseTransitionModifier flag is true)
// // then need to check if this has been changed, and allow a save/cancel if so.
// if (cbPageNum.Visible && _ModExistingPageNum != cbPageNum.Checked)
// btnTranCancel.Enabled = btnTranSave.Enabled = true;
// else
// btnTranCancel.Enabled = btnTranSave.Enabled = false;
// }
// else
// {
// btnTranCancel.Enabled = true;
// btnTranSave.Enabled = allowSave;
// }
//}
//else btnTranCancel.Enabled = btnTranSave.Enabled = allowSave;
}
private void btnTranCancel_Click(object sender, EventArgs e)
{
@@ -1314,7 +1193,7 @@ namespace Volian.Controls.Library
}
private void btnTranSave_Click(object sender, EventArgs e)
{
string trantxt = "(Resolved Transition Text)";
string trantxt; //Resolved Transition Text
string linktxt = null;
E_TransUI etm = (E_TransUI)_CurItemFrom.ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[listBoxTranFmt.SelectedIndex].TransUI;
// if must have a step, test for this first.
@@ -1370,16 +1249,13 @@ namespace Volian.Controls.Library
// be sure that the order is right, i.e. to is before range in list.
if (toItem.ItemID != rangeItem.ItemID)
{
Boolean switchIds = false;
// check for order of hls first, then do within sibling list.
switchIds = RangeItemAndToItemNeedsSwitched(toItem, rangeItem); // B2021-115 switchIds was being set to true when it should not have
// check for order of hls first, then do within sibling list.
Boolean switchIds = RangeItemAndToItemNeedsSwitched(toItem, rangeItem); // B2021-115 switchIds was being set to true when it should not have
if (switchIds)
{
ItemInfo switchItem = toItem;
toItem = rangeItem;
rangeItem = switchItem;
}
}
(rangeItem, toItem) = (toItem, rangeItem);
}
}
linktxt = string.Format("#Link:TransitionRange:{0} <NewID> {1} {2}", listBoxTranFmt.SelectedIndex, toItem.ItemID, rangeItem.ItemID);
}
else if ((etm & E_TransUI.StepFirst) == E_TransUI.StepFirst)
@@ -1496,7 +1372,7 @@ namespace Volian.Controls.Library
if (node1==null && node2==null) return;
if (node1 != null && node2 == null)
{
node1.BackColor = on ? _RangeColor : tvTran.BackColor;
node1.BackColor = on ? RangeColor : tvTran.BackColor;
return;
}
// If node2 is below node1 in the tree switch them... get to high level step &
@@ -1520,15 +1396,13 @@ namespace Volian.Controls.Library
}
if (i1 > i2)
{
VETreeNode t = node2;
node2 = node1;
node1 = t;
}
(node1, node2) = (node2, node1);
}
// Turn Hilighting on/off (depending on bool argument) between the two nodes
// they may be at different tree levels.
// find common parent level first and save the 'top parent' node for each selection.
VETreeNode top1 = node1;
// Turn Hilighting on/off (depending on bool argument) between the two nodes
// they may be at different tree levels.
// find common parent level first and save the 'top parent' node for each selection.
VETreeNode top1 = node1;
VETreeNode top2 = node2;
// loop, walking up node2's tree checking against node1. If not found, go to node1
// parent, etc.
@@ -1551,8 +1425,8 @@ namespace Volian.Controls.Library
VETreeNode cur = node1;
while (cur != null)
{
cur.BackColor = on ? _RangeColor : tvTran.BackColor;
cur = (VETreeNode)(cur.NextNode == null ? cur.Parent : cur.NextNode);
cur.BackColor = on ? RangeColor : tvTran.BackColor;
cur = (VETreeNode)(cur.NextNode ?? cur.Parent);
// if these nodes were at the same level, then stop after the current node = range2
if (cur == top1) cur = null; // stop at top
if (cur == top2) top1 = cur = null;
@@ -1561,32 +1435,27 @@ namespace Volian.Controls.Library
cur = top1==null?null:(VETreeNode)top1.NextNode;
while (cur != null)
{
cur.BackColor = on ? _RangeColor : tvTran.BackColor;
cur.BackColor = on ? RangeColor : tvTran.BackColor;
cur = (cur == top2) ? null : (VETreeNode)cur.NextNode;
}
// finish subtree of second node in range.
cur = top2==node2?null:node2;
while (cur != null)
{
cur.BackColor = on ? _RangeColor : tvTran.BackColor;
cur = (VETreeNode)(cur.PrevNode == null ? cur.Parent : cur.PrevNode);
cur.BackColor = on ? RangeColor : tvTran.BackColor;
cur = (VETreeNode)(cur.PrevNode ?? cur.Parent);
if (cur == top2) cur = null; // stop at top
}
// hilite last selection..
top2.BackColor = on ? _RangeColor : tvTran.BackColor;
top2.BackColor = on ? RangeColor : tvTran.BackColor;
}
#endregion
public DocVersionInfo Mydvi = null; // this is initialized in vlnTreeComboSetsFillIn()
private static UserInfo _MyUserInfo = null;
public static UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
public static UserInfo MyUserInfo { get; set; } = null;
private void cbIncStepNum_CheckedChanged(object sender, EventArgs e)
private void cbIncStepNum_CheckedChanged(object sender, EventArgs e)
{
tvTran.Enabled=cbIncStepNum.Checked;
if (!_InitializingTrans) SaveCancelEnabling();
@@ -1610,14 +1479,13 @@ namespace Volian.Controls.Library
if (cbHoldProcSet.Checked)
{
VETreeNode vt = tvTran.SelectedNode as VETreeNode;
ItemInfo selii = vt.VEObject as ItemInfo;
if (selii != null)
{
HeldLinkText = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, selii.ItemID);
HeldLink_TranFmtIndx = listBoxTranFmt.SelectedIndex;
HeldLink_CurItemFrom = selii;
}
}
if (vt.VEObject is ItemInfo selii)
{
HeldLinkText = string.Format("#Link:Transition:{0} <NewID> {1}", listBoxTranFmt.SelectedIndex, selii.ItemID);
HeldLink_TranFmtIndx = listBoxTranFmt.SelectedIndex;
HeldLink_CurItemFrom = selii;
}
}
else
{
HeldLinkText = "";
@@ -1628,29 +1496,17 @@ namespace Volian.Controls.Library
}
public class TransItem
{
private string _ItemDescription;
public string ItemDescription { get; set; }
public string ItemDescription
public string Format { get; set; }
public TransItem(string desc, string fmt)
{
get { return _ItemDescription; }
set { _ItemDescription = value; }
}
private string _Format;
public string Format
{
get { return _Format; }
set { _Format = value; }
}
public TransItem(string desc, string fmt)
{
_ItemDescription = desc;
_Format = fmt;
ItemDescription = desc;
Format = fmt;
}
public override string ToString()
{
return _ItemDescription;
return ItemDescription;
}
}
}
+2 -25
View File
@@ -1,4 +1,3 @@
using System;
using System.Windows.Forms;
using AT.STO.UI.Win;
@@ -8,16 +7,9 @@ namespace Volian.Controls.Library
internal class DropDownNode : TreeNode, ILookupItem<long>
{
#region Private Variable Declarations
private long _id = 0;
private readonly long _id = 0;
#endregion
#region Constructor / Destructor
/// <summary>
/// Default constructor.
/// </summary>
public DropDownNode() : base()
{
}
/// <summary>
/// /// <summary>
/// Some constructors initializing the node with Id.
@@ -29,26 +21,11 @@ namespace Volian.Controls.Library
{
_id = Id;
}
public DropDownNode(long Id, string Text, DropDownNode[] Children) : base(Text, Children)
{
_id = Id;
}
public DropDownNode(long Id, string Text, int ImageIndex, int SelectedImageIndex) : base(Text, ImageIndex, SelectedImageIndex)
{
_id = Id;
}
public DropDownNode(long Id, string Text, int ImageIndex, int SelectedImageIndex, DropDownNode[] Children) : base(Text, ImageIndex, SelectedImageIndex, Children)
{
_id = Id;
}
#endregion
#region Public Methods
public override string ToString()
{
return this.GetType().Name + " (Id=" + Id.ToString() + ", Name=" + Text + ")";
return $"{this.GetType().Name} (Id={Id}, Name={Text})";
}
#endregion
#region ILookupItem<long> Implementation
@@ -21,12 +21,9 @@ namespace Volian.Controls.Library
protected override void OnAfterSelect(TreeViewEventArgs e)
{
base.OnAfterSelect(e);
if (ValueChanged != null)
{
ValueChanged(this, new DropDownValueChangedEventArgs(e.Node));
}
}
ValueChanged?.Invoke(this, new DropDownValueChangedEventArgs(e.Node));
}
/// <summary>
/// A double click on a node counts as finish editing.
/// </summary>
File diff suppressed because it is too large Load Diff
+26 -56
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
@@ -16,14 +12,9 @@ namespace Volian.Controls.Library
{
private bool doingfind = false;
private bool findingbookmarks = false;
private bool _FoundIt = false;
private ItemInfo _StartingItemInfo = null;// C2023-016 used to remember where we started doing the Find/Replace
public bool FoundIt
{
get { return _FoundIt; }
set { _FoundIt = value; }
}
private bool IsFound
private ItemInfo _StartingItemInfo = null;// C2023-016 used to remember where we started doing the Find/Replace
public bool FoundIt { get; set; } = false;
private bool IsFound
{
get
{
@@ -43,32 +34,17 @@ namespace Volian.Controls.Library
{
_MyEditItem = value;
if (_MyEditItem == null) return;
_MyDocVersion = _MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
Mydocversion = _MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo;
SetupContextMenu();
}
}
private DocVersionInfo _MyDocVersion;
public DocVersionInfo Mydocversion
{
get { return _MyDocVersion; }
set {_MyDocVersion = value; }
}
private DisplayBookMarks _myDisplayBookMarks;
public DisplayBookMarks MyDisplayBookMarks
{
get { return _myDisplayBookMarks; }
set { _myDisplayBookMarks = value; }
}
public DocVersionInfo Mydocversion { get; set; }
private bool _InApproved;
public DisplayBookMarks MyDisplayBookMarks { get; set; }
public bool InApproved
{
get { return _InApproved; }
set { _InApproved = value; }
}
public FindReplace()
public bool InApproved { get; set; }
public FindReplace()
{
InitializeComponent();
LoadFindReplaceTextListBox();
@@ -203,7 +179,7 @@ namespace Volian.Controls.Library
// C2023-016 Find the next element, but stay in the same procedure
private ItemInfo FindNextStepElement(ItemInfo curStepElem, string fndStr)
{
ItemInfo nxtStepElem = curStepElem;
ItemInfo nxtStepElem;
if (_StartingItemInfo == null)
_StartingItemInfo = MyEditItem.MyItemInfo;
if (cbxReverse.Checked)
@@ -267,11 +243,6 @@ namespace Volian.Controls.Library
}
FoundIt = true;
}
private bool FindNextText(ItemInfo next)
{
if (next.MyContent.MyGrid!=null) return true;
return next.MyContent.Text.ToUpper().Contains(cmboFindText.Text.ToUpper());
}
private void AddToComboLists()
{
bool hastext = this.cmboFindText.Text.Length > 0;
@@ -304,11 +275,6 @@ namespace Volian.Controls.Library
_StartingItemInfo = null;//C2023-016 reset the starting position
}
public void PerformFindNext()
{
btnFindNext.PerformClick();
}
private void tabFind_Click(object sender, EventArgs e)
{
lblRplTxt.Visible = false;
@@ -360,9 +326,11 @@ namespace Volian.Controls.Library
IDataObject myDO = Clipboard.GetDataObject();
if (myDO.GetDataPresent(DataFormats.Rtf))
{
RichTextBox rtb = new RichTextBox();
rtb.SelectedRtf = ItemInfo.StripLinks(myDO.GetData(DataFormats.Rtf).ToString());
if (cmboReplaceText.Focused)
RichTextBox rtb = new RichTextBox
{
SelectedRtf = ItemInfo.StripLinks(myDO.GetData(DataFormats.Rtf).ToString())
};
if (cmboReplaceText.Focused)
cmboReplaceText.SelectedText = rtb.Text;
else if (cmboFindText.Focused)
cmboFindText.SelectedText = rtb.Text;
@@ -394,9 +362,9 @@ namespace Volian.Controls.Library
private void SetupContextMenu()
{
galSymbols.SubItems.Clear();
if (_MyDocVersion != null)
if (Mydocversion != null)
{
FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData;
FormatData fmtdata = Mydocversion.ActiveFormat.PlantFormat.FormatData;
SymbolList sl = fmtdata.SymbolList;
if (sl == null || sl.Count <= 0)
{
@@ -405,14 +373,16 @@ namespace Volian.Controls.Library
}
foreach (Symbol sym in sl)
{
DevComponents.DotNetBar.ButtonItem btnCM = new DevComponents.DotNetBar.ButtonItem();
btnCM.Text = string.Format("{0}", (char)sym.Unicode);
// to name button use unicode rather than desc, desc may have spaces or odd chars
btnCM.Name = "btnCM" + sym.Unicode.ToString();
btnCM.Tooltip = sym.Desc;
btnCM.Tag = string.Format(@"{0}", sym.Unicode);
btnCM.FontBold = true;
btnCM.Click += new System.EventHandler(btnSym_Click);
DevComponents.DotNetBar.ButtonItem btnCM = new DevComponents.DotNetBar.ButtonItem
{
Text = string.Format("{0}", (char)sym.Unicode),
// to name button use unicode rather than desc, desc may have spaces or odd chars
Name = "btnCM" + sym.Unicode.ToString(),
Tooltip = sym.Desc,
Tag = string.Format(@"{0}", sym.Unicode),
FontBold = true
};
btnCM.Click += new System.EventHandler(btnSym_Click);
galSymbols.SubItems.Add(btnCM);
}
}
+12 -19
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Design;
using System.Windows.Forms.Design;
@@ -13,7 +10,8 @@ namespace Volian.Controls.Library
public class FlagCheckedListBox : CheckedListBox
{
private System.ComponentModel.Container components = null;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
private System.ComponentModel.Container components = null;
public FlagCheckedListBox()
{
@@ -28,8 +26,7 @@ namespace Volian.Controls.Library
{
if (disposing)
{
if (components != null)
components.Dispose();
components?.Dispose();
}
base.Dispose(disposing);
}
@@ -37,9 +34,6 @@ namespace Volian.Controls.Library
#region Component Designer generated code
private void InitializeComponent()
{
//
// FlaggedCheckedListBox
//
this.CheckOnClick = true;
}
@@ -127,7 +121,7 @@ namespace Volian.Controls.Library
// If the item has been unchecked, remove its bits from the sum
if (cs == CheckState.Unchecked)
sum = sum & (~composite.value);
sum &= (~composite.value);
// If the item has been checked, combine its bits with the sum
else
sum |= composite.value;
@@ -239,13 +233,15 @@ namespace Volian.Controls.Library
public class FlagEnumUIEditor : UITypeEditor
{
// The checklistbox
private FlagCheckedListBox flagEnumCB;
private readonly FlagCheckedListBox flagEnumCB;
public FlagEnumUIEditor()
{
flagEnumCB = new FlagCheckedListBox();
flagEnumCB.BorderStyle = BorderStyle.None;
}
flagEnumCB = new FlagCheckedListBox
{
BorderStyle = BorderStyle.None
};
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
@@ -269,12 +265,9 @@ namespace Volian.Controls.Library
return null;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.DropDown;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) => UITypeEditorEditStyle.DropDown;
}
}
}
@@ -1,9 +1,6 @@
using Csla;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using VEPROMS.CSLA.Library;
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
+20 -21
View File
@@ -34,9 +34,9 @@ namespace Volian.Controls.Library
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GridItem));
this.lblTab = new System.Windows.Forms.Label();
this._MyToolTip = new DevComponents.DotNetBar.SuperTooltip();
this._MyFlexGrid = new Volian.Controls.Library.VlnFlexGrid(this.components);
this.MyFlexGrid = new Volian.Controls.Library.VlnFlexGrid(this.components);
this._MyDisablePanel = new vlnPanel();
((System.ComponentModel.ISupportInitialize)(this._MyFlexGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MyFlexGrid)).BeginInit();
this.SuspendLayout();
//
// lblTab
@@ -55,21 +55,21 @@ namespace Volian.Controls.Library
//
// _MyFlexGrid
//
this._MyFlexGrid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom;
this._MyFlexGrid.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.Both;
this._MyFlexGrid.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this._MyFlexGrid.ColumnInfo = "3,0,0,0,0,40,Columns:";
this._MyFlexGrid.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
this._MyFlexGrid.FocusRect = C1.Win.C1FlexGrid.FocusRectEnum.Solid;
this._MyFlexGrid.Location = new System.Drawing.Point(5, 5);
this._MyFlexGrid.Name = "_MyFlexGrid";
this._MyFlexGrid.Rows.Count = 4;
this._MyFlexGrid.Rows.DefaultSize = 20;
this._MyFlexGrid.Rows.Fixed = 0;
this._MyFlexGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this._MyFlexGrid.Size = new System.Drawing.Size(314, 66);
this._MyFlexGrid.StyleInfo = resources.GetString("_MyFlexGrid.StyleInfo");
this._MyFlexGrid.TabIndex = 4;
this.MyFlexGrid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom;
this.MyFlexGrid.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.Both;
this.MyFlexGrid.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.MyFlexGrid.ColumnInfo = "3,0,0,0,0,40,Columns:";
this.MyFlexGrid.DrawMode = C1.Win.C1FlexGrid.DrawModeEnum.OwnerDraw;
this.MyFlexGrid.FocusRect = C1.Win.C1FlexGrid.FocusRectEnum.Solid;
this.MyFlexGrid.Location = new System.Drawing.Point(5, 5);
this.MyFlexGrid.Name = "_MyFlexGrid";
this.MyFlexGrid.Rows.Count = 4;
this.MyFlexGrid.Rows.DefaultSize = 20;
this.MyFlexGrid.Rows.Fixed = 0;
this.MyFlexGrid.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.MyFlexGrid.Size = new System.Drawing.Size(314, 66);
this.MyFlexGrid.StyleInfo = resources.GetString("_MyFlexGrid.StyleInfo");
this.MyFlexGrid.TabIndex = 4;
//
// _MyDisablePanel
//
@@ -81,13 +81,13 @@ namespace Volian.Controls.Library
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this._MyFlexGrid);
this.Controls.Add(this.MyFlexGrid);
this.Controls.Add(this._MyDisablePanel);
this.Controls.Add(this.lblTab);
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "GridItem";
this.Size = new System.Drawing.Size(320, 72);
((System.ComponentModel.ISupportInitialize)(this._MyFlexGrid)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MyFlexGrid)).EndInit();
this.ResumeLayout(false);
}
@@ -96,7 +96,6 @@ namespace Volian.Controls.Library
private System.Windows.Forms.Label lblTab;
private DevComponents.DotNetBar.SuperTooltip _MyToolTip;
private VlnFlexGrid _MyFlexGrid;
private vlnPanel _MyDisablePanel;
private vlnPanel _MyDisablePanel;
}
}
+73 -264
View File
@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;
//using System.IO;
using System.Windows.Forms;
using System.Xml;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using C1.Win.C1FlexGrid;
@@ -24,51 +19,32 @@ namespace Volian.Controls.Library
{
get
{
ItemInfo procInfo = MyItemInfo.MyProcedure as ItemInfo;
if (procInfo == null)
_MyDVI = null;
else
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
return _MyDVI;
if (!(MyItemInfo.MyProcedure is ItemInfo procInfo))
_MyDVI = null;
else
_MyDVI = procInfo.ActiveParent as DocVersionInfo;
return _MyDVI;
}
}
private static UserInfo _MyUserInfo = null;
public static UserInfo MyUserInfo
{
get { return _MyUserInfo; }
set { _MyUserInfo = value; }
}
private bool _IsSaving;
public bool IsSaving
{
get { return _IsSaving; }
set { _IsSaving = value; }
}
public VlnFlexGrid MyFlexGrid
{
get { return _MyFlexGrid; }
set { _MyFlexGrid = value; }
}
private int _GridMargin = 11;
/// <summary>
/// Margin between the EditItem and the VlnFlexGrid. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public int GridMargin
{
get { return _GridMargin; }
set { _GridMargin = value; }
}
#endregion
#region Event Handlers
/// <summary>
/// Raises an ItemClick event when the user clicks on the Tab
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void lblTab_MouseDown(object sender, MouseEventArgs e)
public static UserInfo MyUserInfo { get; set; } = null;
public bool IsSaving { get; set; }
public VlnFlexGrid MyFlexGrid { get; set; }
/// <summary>
/// Margin between the EditItem and the VlnFlexGrid. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public int GridMargin { get; set; } = 11;
#endregion
#region Event Handlers
/// <summary>
/// Raises an ItemClick event when the user clicks on the Tab
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void lblTab_MouseDown(object sender, MouseEventArgs e)
{
MyStepPanel.OnItemClick(this, new StepPanelEventArgs(this, e));
}
@@ -145,7 +121,6 @@ namespace Volian.Controls.Library
void MyStepRTB_AdjustTableWidth(object sender, StepRTBTableWidthEventArgs args)
{
//Console.WriteLine("MyStepRTB_AdjustTableWidth");
//if ((!_MyItemInfo.IsSection && !_MyItemInfo.IsProcedure) && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure))
if (args.EditMode)
{
int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
@@ -167,28 +142,13 @@ namespace Volian.Controls.Library
}
}
}
bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args)
{
return MyStepPanel.SelectedEditItem != this;
}
bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args) => MyStepPanel.SelectedEditItem != this;
void MyStepRTB_OpenAnnotations(object sender, EventArgs args)
{
OpenAnnotations();
}
void MyFlexGrid_OpenAnnotations(object sender, EventArgs args)
{
OpenAnnotations();
}
void MyStepRTB_DoMouseWheel(object sender, MouseEventArgs args)
{
DoMouseWheel(args);
}
void MyStepRTB_DoSaveContents(object sender, EventArgs args)
{
SaveCurrentAndContents();
}
void MyStepRTB_VisibleChanged(object sender, EventArgs e)
void MyStepRTB_OpenAnnotations(object sender, EventArgs args) => OpenAnnotations();
void MyFlexGrid_OpenAnnotations(object sender, EventArgs args) => OpenAnnotations();
void MyStepRTB_DoMouseWheel(object sender, MouseEventArgs args) => DoMouseWheel(args);
void MyStepRTB_DoSaveContents(object sender, EventArgs args) => SaveCurrentAndContents();
void MyStepRTB_VisibleChanged(object sender, EventArgs e)
{
if (MyStepRTB == null) return;
MyStepRTB.EditMode = MyStepRTB.Visible;
@@ -204,7 +164,6 @@ namespace Volian.Controls.Library
void MyFlexGrid_Click(object sender, EventArgs e)
{
MyFlexGrid.Focus();
//MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ToggleTableDesignButtons(false);
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetTableButtonsForMergeRangeSelection();
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridContextMenu();
@@ -235,7 +194,6 @@ namespace Volian.Controls.Library
private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore
void MyFlexGrid_SelChange(object sender, EventArgs e)
{
//if (Initializing) return;
//Volian.Base.Library.vlnStackTrace.ShowStackLocal("MyFlexGrid_SelChange {0}",MyFlexGrid.Selection);
RTBLastFocus = false;
MyStepRTB.Visible = false; // Hide the editor if the Selection Changes
@@ -244,7 +202,7 @@ namespace Volian.Controls.Library
{
// B2020-088: get string using method in case of merged cells
string rtf = MyFlexGrid.GetCellRTFString(MyFlexGrid.Row, MyFlexGrid.Col);
_OrigRtf = rtf == null ? string.Empty : rtf;
_OrigRtf = rtf ?? string.Empty;
}
}
void MyStepRTB_KeyDown(object sender, KeyEventArgs e)
@@ -310,7 +268,6 @@ namespace Volian.Controls.Library
this.MyStepRTB.SetMenu += new StepRTBMenuEvent(MyStepRTB_SetMenu);
this.MyStepRTB.OpenContextMenu += new StepRTBLocationEvent(MyStepRTB_OpenContextMenu);
this.MyFlexGrid.EnterKeyPressed += new VlnFlexGridkeyEvent(MyFlexGrid_EnterKeyPressed);
//this.MyStepRTB.EnterKeyPressed += new StepRTBCursorKeysEvent(MyStepRTB_EnterKeyPressed);
// This Resize event has been useful for debugging purposes numerous times
//
//this.MyStepRTB.Resize += new EventHandler(MyStepRTB_Resize);
@@ -330,12 +287,6 @@ namespace Volian.Controls.Library
cs.BackColor = MyFlexGrid.MyShading.GetColor(MyFlexGrid.Row, MyFlexGrid.Col); // C2021-004 reset the last active table cell's shading color when leaving
}
//void MyStepRTB_EnterKeyPressed(object sender, KeyEventArgs args)
//{
// args.Handled = true;
// MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey();
//}
void MyFlexGrid_EnterKeyPressed(object sender, KeyEventArgs args)
{
args.Handled = true;
@@ -352,16 +303,6 @@ namespace Volian.Controls.Library
SetMenu(args.MenuGroup);
}
// This Resize event been useful for debugging purposes numerous times
//
//void MyStepRTB_Resize(object sender, EventArgs e)
//{
// if (MyStepRTB.Visible)
// {
// //Volian.Base.Library.vlnStackTrace.ShowStack("MyStepRTB_Resize");
// Console.WriteLine("MyStepRTB_Resize {0}", MyStepRTB.Width);
// }
//}
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
{
//Console.WriteLine("GridItem - Enter MyStepRTB_RoInsert");
@@ -372,12 +313,6 @@ namespace Volian.Controls.Library
MyFlexGrid.FixTableCellsHeightWidth();
MyFlexGrid.AdjustGridControlSize();
MyFlexGrid.Visible = true;
//MyFlexGrid.MergedRanges.Clear();
//MyFlexGrid.Clear();
//ConvertTableToGrid(args.RawValText, args.RODbID, args.ROID);
//MyFlexGrid.RODbId = args.RODbID;
//MyFlexGrid.ROID = args.ROID;
//SaveContents();
}
else
{
@@ -400,18 +335,7 @@ namespace Volian.Controls.Library
#endregion
#region Override Method and Properties
public override int BorderWidth { get { return (MyFlexGrid.Width - MyFlexGrid.ClientRectangle.Width); } }
//private bool _OnlyOnce = false;
//protected override void OnPaint(PaintEventArgs e)
//{
// base.OnPaint(e);
// if (!this.Enabled && !_OnlyOnce)
// {
// _OnlyOnce = true;
// _MyDisablePanel.SendToBack();
// _MyDisablePanel.BringToFront();
// _OnlyOnce = false;
// }
//}
protected override void OnEnabledChanged(EventArgs e)
{
base.OnEnabledChanged(e);
@@ -430,7 +354,6 @@ namespace Volian.Controls.Library
{
gr.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
gr.FillRectangle(new SolidBrush(Color.FromArgb(128, Color.FromKnownColor(KnownColor.ButtonFace))), rect);
//gr.FillEllipse(Brushes.Red, 10, 10, 10, 10);
}
_MyDisablePanel.Location = this.MyFlexGrid.Location;
_MyDisablePanel.Size = this.MyFlexGrid.Size;
@@ -446,10 +369,6 @@ namespace Volian.Controls.Library
public override string TabFormat { get { return _TabFormat; } set { _TabFormat = value; } }
public override void AdjustTableWidthAndLocation()
{
//_MyStepRTB.Font = MyStepData.Font.WindowsFont;
//ItemWidth = (int)GetTableWidth(MyStepRTB.Font, MyItemInfo.MyContent.Text, true);
//ItemWidth = MyFlexGrid.Width;
//ItemLocation = new Point(50, _MyParentEditItem.Bottom);
// We had a table that was in a funky state. This allows it to appear in editor so
// that is could be deleted.
@@ -586,11 +505,11 @@ namespace Volian.Controls.Library
}
}
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
}
}
@@ -651,35 +570,17 @@ namespace Volian.Controls.Library
// if no ro has been defined yet, just return null
if (MyFlexGrid.ROID == null) return null;
ContentRoUsage rousg = null;
// using (Item itm = MyItemInfo.Get())
// {
using (RODb rodb = RODb.GetJustRoDb(MyFlexGrid.RODbId))
{
string padroid = (MyFlexGrid.ROID.Length <= 12) ? MyFlexGrid.ROID + "0000" : MyFlexGrid.ROID;
rousg = itm.MyContent.ContentRoUsages.Add(MyFlexGrid.ROID, rodb);
}
//itm.Save();
// }
MyItemInfo.MyContent.RefreshContentRoUsages();
return string.Format(@"#Link:ReferencedObject:{0} {1} {2}", rousg.ROUsageID, MyFlexGrid.ROID, MyFlexGrid.RODbId);
}
//private void ConvertTableToGrid(string valtext, int rodbid, string roid)
//{
// VE_Font vefont = MyItemInfo.GetItemFont();
// MyFlexGrid.Font = vefont.WindowsFont;
// //Initializing = true;
// MyFlexGrid.MergedRanges.Clear();
// MyFlexGrid.Clear();
// MyFlexGrid.ParseTableFromText(valtext);
// MyFlexGrid.AutoSizeCols();
// MyFlexGrid.AutoSizeRows();
// MyFlexGrid.MakeRTFcells();
// MyFlexGrid.RODbId = rodbid;
// MyFlexGrid.ROID = roid;
// MyFlexGrid.IsRoTable = true;
// //Initializing = false;
// SaveContents();
//}
private bool FinishSave(string searchableText)
{
// Just in case if the grid was in a mode to change sizes, clear out that setting
@@ -691,13 +592,9 @@ namespace Volian.Controls.Library
string xml = MyFlexGrid.GetXMLData();
using (Item itm = MyItemInfo.Get())
{
//if (!MatchingXML(itm.MyContent.MyGrid.Data, xml))
//{
// CompareXML(itm.MyContent.MyGrid.Data, xml);
itm.MyContent.MyGrid.Data = xml;
itm.MyContent.MyGrid.DTS = DateTime.Now;
itm.MyContent.MyGrid.UserID = Volian.Base.Library.VlnSettings.UserID;
//}
// if this is the initial save of an ro table, then the 'DoLinkForRoTable' will
// create the usage for it. this code gets run on modify of the ro table and also
// on exit of the griditem. We don't want to save the ro usage again, if it's already
@@ -705,12 +602,9 @@ namespace Volian.Controls.Library
if (MyFlexGrid.IsRoTable && MyFlexGrid.ROID != null && itm.MyContent.ContentRoUsageCount < 1)
{
searchableText = string.Format(@"\v<START]\v0 {0} \v {1}[END>\v0 ", searchableText, DoLinkForRoTable(itm));
//if (itm.MyContent.Text != searchableText)
//{
itm.MyContent.Text = searchableText;
itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.MyContent.DTS = DateTime.Now;
//}
}
else
{
@@ -726,82 +620,30 @@ namespace Volian.Controls.Library
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds &&
!this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
{
StepConfig sc = itm.MyConfig as StepConfig;
if (sc == null)
sc = new StepConfig();
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
if (!(itm.MyConfig is StepConfig sc))
sc = new StepConfig();
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
if (itm.MyConfig == null) itm.MyContent.Config = sc.ToString();
}
itm.Save();
StepConfig myItmCfg =MyItemInfo.MyConfig as StepConfig;
// We saved changes made to some step text. Reset the change bar override.
// IF there is a step config remove the change bar override by setting the CBOverride value to null
// This fixes a problem reported by Farly where if the change bar or overridden to be off, the next
// time a change was made, the change bar remained turned off.
if (myItmCfg != null)
myItmCfg.Step_CBOverride = null; // clear the change bar override
// We saved changes made to some step text. Reset the change bar override.
// IF there is a step config remove the change bar override by setting the CBOverride value to null
// This fixes a problem reported by Farly where if the change bar or overridden to be off, the next
// time a change was made, the change bar remained turned off.
if (MyItemInfo.MyConfig is StepConfig myItmCfg)
myItmCfg.Step_CBOverride = null; // clear the change bar override
MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
}
return true;
}
private void CompareXML(string v1, string v2)
{
v1 = Regex.Replace(v1, "\r\n *", "");
v1 = Regex.Replace(v1, "version *= *\"[^\"]*\"", "");
v2 = Regex.Replace(v2, "\r\n *", "");
v2 = Regex.Replace(v2, "version *= *\"[^\"]*\"", "");
int iStart = 0;
int l1 = v1.Length;
int l2 = v2.Length;
int l3 = Math.Min(l1, l2);
while (iStart < l3 && v1[iStart] == v2[iStart])
iStart++;
int iEnd1 = l1 - 1;
int iEnd2 = l2 - 1;
while (iStart < iEnd1 && iStart < iEnd2 && v1[iEnd1] == v2[iEnd2])
{
iEnd1--;
iEnd2--;
}
if (iStart < iEnd1) Console.WriteLine("v1 = {0}", v1.Substring(iStart, iEnd1 - iStart));
if (iStart < iEnd2) Console.WriteLine("v2 = {0}", v2.Substring(iStart, iEnd2 - iStart));
}
private bool MatchingXML(string v1, string v2)
{
v1 = Regex.Replace(v1, "\r\n *", "");
v1 = Regex.Replace(v1, "version *= *\"[^\"]*\"", "");
v2 = Regex.Replace(v2, "\r\n *", "");
v2 = Regex.Replace(v2, "version *= *\"[^\"]*\"", "");
int l1 = v1.Length;
int l2 = v2.Length;
if(l1 != l2 )return false;
//int l3 = Math.Min(l1, l2);
//int l4 = Math.Max(l1, l2);
for (int i = 0; i < l1; i++)
if (v1[i] != v2[i]) return false;
return true;
//Console.WriteLine("{0} - {1},{2}",i, showChar(v1[i]), showChar(v2[i]));
//if(l1 > l3)Console.WriteLine("v1 = {0}",v1.Substring(l3));
//if(l2 > l3)Console.WriteLine("v2 = {0}",v2.Substring(l3));
}
//private object showChar(char c)
//{
// int i = (int)c;
// if (i <= 32)
// return string.Format("<{0}>", i);
// else
// return c.ToString();
//}
public void BasicSave()
{
using (Item itm = MyItemInfo.Get())
{
itm.MyContent.MyGrid.Data = MyFlexGrid.GetXMLData();
itm.Save();
//MyItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid);
}
}
public override bool CanExpand { get { return false; } set { ;} }
@@ -821,8 +663,8 @@ namespace Volian.Controls.Library
MyFlexGrid.Select(0, 0);
MyFlexGrid.FirstEntry = true; // to fix a problem with initial mouse click into table
}
catch (Exception ex)
{
catch (Exception)
{
FlexibleMessageBox.Show("The content of this table is corrupted. You will either need to restore a previous version or delete it.", "Table Corrupted", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
@@ -831,22 +673,14 @@ namespace Volian.Controls.Library
{
_MyLog.WarnFormat("Attempt to give Focus to Disposed Object {0}", MyID);
}
//ScrollToCenter();
}
public override void ItemShow()
{
MyFlexGrid.Focus();
//ScrollToCenter();
}
public StepRTB DisplayRoStepRTB;
public override StepRTB MyStepRTB
{
get
{
return MyFlexGrid.TableCellEditor;
}
}
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
public override StepRTB MyStepRTB => MyFlexGrid.TableCellEditor;
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
{
int r = MyFlexGrid.Row;
int c = MyFlexGrid.Col;
@@ -874,11 +708,11 @@ namespace Volian.Controls.Library
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
if (r < h)
{
@@ -908,11 +742,11 @@ namespace Volian.Controls.Library
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr;
}
c = c - 1;
c--;
if (c < 0)
{
c = MyFlexGrid.Cols.Count - 1;
r = r - 1;
r--;
}
cr = MyFlexGrid.GetMergedRange(r, c);
if (r >= 0 && cr.r1 == r && cr.c1 == c)
@@ -946,11 +780,11 @@ namespace Volian.Controls.Library
bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
if (scn) return true;
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
if (r < h)
{
@@ -972,11 +806,11 @@ namespace Volian.Controls.Library
bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
if (scn) return true;
}
c = c - 1;
c--;
if (c < 0)
{
c = MyFlexGrid.Cols.Count - 1;
r = r - 1;
r--;
}
cr = MyFlexGrid.GetMergedRange(r, c);
if (r >= 0 && cr.r1 == r && cr.c1 == c)
@@ -1002,11 +836,11 @@ namespace Volian.Controls.Library
MyFlexGrid.StartEditing();
return;
}
c = c - 1;
c--;
if (c < 0)
{
c = MyFlexGrid.Cols.Count - 1;
r = r - 1;
r--;
}
if (r >= 0)
{
@@ -1055,11 +889,11 @@ namespace Volian.Controls.Library
if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf;
if (!scn) return false;
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
}
return true;
@@ -1092,29 +926,19 @@ namespace Volian.Controls.Library
MyFlexGrid.ShowTableCellShading();
}
}
public override void SetActive()
{
AdjustColorsForEditMode();
}
private bool _Empty = false;
public override void SetActive() => AdjustColorsForEditMode();
private bool _Empty = false;
public override bool Empty
{
get { return _Empty; }
set { _Empty = value; }
}
private bool _Initializing = false;
public bool Initializing
{
get { return _Initializing; }
set { _Initializing = value; }
}
private bool _ActiveMode = false;
public bool Initializing { get; set; } = false;
private bool _ActiveMode = false;
public override void RefreshDisplay(bool activeMode)
{
_ActiveMode = activeMode;
//XmlDocument xd = new XmlDocument();
//xd.LoadXml(MyItemInfo.MyContent.MyGrid.Data);
//using (StringReader sr = new StringReader())
Initializing = true;
MyFlexGrid.LoadGrid(MyItemInfo);
Initializing = false;
@@ -1148,24 +972,10 @@ namespace Volian.Controls.Library
{
// if this is an RO Table, regenerate xml. This is done in the case that
// the rotable was updated by the ro editor.
//if (MyFlexGrid.IsRoTable) RefreshGridData();
RefreshDisplay(false);
IdentifyMe(false);
}
//private void RefreshGridData()
//{
// string ROID = MyFlexGrid.ROID;
// int rodbid = MyFlexGrid.RODbId;
// //MyFlexGrid.Clear();
// ROFSTLookup MyROFSTLookup = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
// MyFlexGrid.ConvertTableROToGrid(MyROFSTLookup.GetRoValue(ROID), rodbid, ROID);
// //ConvertTableToGrid(MyROFSTLookup.GetRoValue(ROID), rodbid, ROID);
// //MyFlexGrid.RODbId = rodbid;
// //MyFlexGrid.ROID = ROID;
// //MyFlexGrid.IsRoTable = true;
// //SaveContents();
//}
public override void SetExpandAndExpander(ItemInfo itemInfo) { CanExpand = false; } // can't expand a table
public void SavePastedCellRoTran()
{
@@ -1176,7 +986,7 @@ namespace Volian.Controls.Library
int h = MyFlexGrid.Rows.Count;
int r = 0;
int c = 0;
String Rtf = null;
string Rtf;
while (r < h)
{
CellRange cr = MyFlexGrid.GetMergedRange(r, c);
@@ -1199,7 +1009,7 @@ namespace Volian.Controls.Library
string linkstr = mro.Groups[2].Value;
string[] roparts = linkstr.Split(" ".ToCharArray());
ContentRoUsage rousg = null;
int oldid = -1;
int oldid;
using (Item itm = MyItemInfo.Get())
{
using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2])))
@@ -1288,11 +1098,11 @@ namespace Volian.Controls.Library
SaveContents();
}
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
}
}
@@ -1304,7 +1114,6 @@ namespace Volian.Controls.Library
CellRange cr = MyFlexGrid.GetMergedRange(MyFlexGrid.Selection.r1, MyFlexGrid.Selection.c1); // B2018-127 get merged range
int row = MyFlexGrid.Row;
int col = MyFlexGrid.Col;
//SaveContents();
DoNotRefresh = true;
MyStepRTB.Rtf = MyStepRTB.DoNewLinkInGridCell();
DoNotRefresh = false;
@@ -1343,11 +1152,11 @@ namespace Volian.Controls.Library
return;
}
}
c = c + 1;
c++;
if (c == w)
{
c = 0;
r = r + 1;
r++;
}
}
}
+31 -111
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;
@@ -16,23 +12,14 @@ namespace Volian.Controls.Library
public partial class ImageItem : EditItem
{
#region IEditItem
// set this for the imageitem so that other code (menuing/ribbons/treeview, etc) will continue to work. Include the MyItemInfo
public override StepRTB MyStepRTB
{
get { return _MyStepRTB; }
}
public override int TableWidth
{
get
{
return (int)_MyPictureBox.Width + ImageMargin;
}
}
/// <summary>
/// The left edge of the Tab
/// </summary>
public override int ItemLeft
#region IEditItem
// set this for the imageitem so that other code (menuing/ribbons/treeview, etc) will continue to work. Include the MyItemInfo
public override StepRTB MyStepRTB => _MyStepRTB;
public override int TableWidth => (int)_MyPictureBox.Width + ImageMargin;
/// <summary>
/// The left edge of the Tab
/// </summary>
public override int ItemLeft
{
get { return Left + lblTab.Left; }
set { Left = value - lblTab.Left; }
@@ -109,11 +96,8 @@ namespace Volian.Controls.Library
RefreshDisplay(false);
SetExpandAndExpander(MyItemInfo);
}
public override void RefreshOrdinal()
{
TabFormat = null;
}
public override void HandleResize() {}
public override void RefreshOrdinal() => TabFormat = null;
public override void HandleResize() {}
public override void MatchExpanded() {}
/// <summary>
/// Sets the focus to this ImageItem
@@ -176,7 +160,7 @@ namespace Volian.Controls.Library
SetWidthsAndHeights(img);
//need this to trigger update of steptabribbonbuttons:
// B2020-083: crash after approve of procedure when no edit window displayed - check for nulls
if (MyStepPanel != null && MyStepPanel.MyStepTabPanel != null) MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling(true);
if (MyStepPanel != null && MyStepPanel.MyStepTabPanel != null) MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling();
}
public override void ToggleEditView(E_ViewMode vwMode) {}
public override string TabFormat
@@ -200,15 +184,9 @@ namespace Volian.Controls.Library
public override Point TabLocation { get { return lblTab.Location; } }
public override Font ContentFont { get { return MyStepRTB.Font; } set { /*MyStepRTB.Font = value*/; } }
public override float ContentTop { get { return MyPictureBox.Top; } }
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
{
return DialogResult.OK;
}
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse)
{
return false;
}
public override void PositionToEnd()
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) => DialogResult.OK;
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) => false;
public override void PositionToEnd()
{
return;
}
@@ -216,15 +194,9 @@ namespace Volian.Controls.Library
{
return;
}
public override string SelectedTextForFind
{
get { return null; }
}
public override bool SpellCheckNext()
{
return true;
}
public override bool Empty
public override string SelectedTextForFind => null;
public override bool SpellCheckNext() => true;
public override bool Empty
{
get
{
@@ -249,22 +221,17 @@ namespace Volian.Controls.Library
get { return _MyPictureBox; }
}
private string FileName = null;
private static int _ImageMargin = 18;
/// <summary>
/// Margin between the EditItem and the ImageItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int ImageMargin
{
get { return _ImageMargin; }
set { _ImageMargin = value; }
}
private bool _IsDirty = false;
/// <summary>
/// Margin between the EditItem and the ImageItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int ImageMargin { get; set; } = 18;
private bool _IsDirty = false;
private int _origCfgHt = 0; // keep track if original size was stored in cfg
private int _origCfgWd = 0;
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
private DisplayTags _displayTags = new DisplayTags();
//House myhouse = new House();
#endregion
#region Constructors
@@ -390,10 +357,7 @@ namespace Volian.Controls.Library
{
InsType = insType;
FileName = null;
//InitializeComponent();
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
//MyPictureBox.Width = 100;
//MyPictureBox.Height = 100;
this.Width = 100 + ImageMargin;
this.Height = 100;
if (insType == ImageItem.E_ImageSource.File)
@@ -409,7 +373,7 @@ namespace Volian.Controls.Library
MyPictureBox.Image = img;
SetWidthsAndHeights(img);
string ext = GetImageFormatExtension(img);
FileName = "paste." + ext;
FileName = $"paste.{ext}";
_IsDirty = true;
}
}
@@ -455,54 +419,10 @@ namespace Volian.Controls.Library
}
}
}
//public static System.Drawing.Imaging.ImageFormat GetImageFormat(this System.Drawing.Image img)
//{
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg))
// return System.Drawing.Imaging.ImageFormat.Jpeg;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Bmp))
// return System.Drawing.Imaging.ImageFormat.Bmp;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Png))
// return System.Drawing.Imaging.ImageFormat.Png;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Emf))
// return System.Drawing.Imaging.ImageFormat.Emf;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Exif))
// return System.Drawing.Imaging.ImageFormat.Exif;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif))
// return System.Drawing.Imaging.ImageFormat.Gif;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Icon))
// return System.Drawing.Imaging.ImageFormat.Icon;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.MemoryBmp))
// return System.Drawing.Imaging.ImageFormat.MemoryBmp;
// if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Tiff))
// return System.Drawing.Imaging.ImageFormat.Tiff;
// else
// return System.Drawing.Imaging.ImageFormat.Wmf;
//}
private static string GetImageFormatExtension(System.Drawing.Image img)
{
return ("jpg"); // seems that this is the only one that works.
/*
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg))
return "jpg";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Bmp))
return "bmp";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Png))
return "png";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Emf))
return "emf";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif))
return "gif";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Icon))
return "ico";
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Tiff))
return "tif";
else
return "wmf";
*/
}
#endregion
#region RO_Images
public void HandleRoImage()
private static string GetImageFormatExtension(System.Drawing.Image img) => ("jpg"); // seems that this is the only one that works.
#endregion
#region RO_Images
public void HandleRoImage()
{
string imageText = null;
ProcedureInfo proc = MyItemInfo.MyProcedure;
@@ -750,7 +670,7 @@ namespace Volian.Controls.Library
MyPictureBox.Image = img;
SetWidthsAndHeights(img);
string ext = GetImageFormatExtension(img);
FileName = "paste." + ext;
FileName = $"paste.{ext}";
}
}
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
@@ -964,7 +884,7 @@ namespace Volian.Controls.Library
{
string ext = ImageItem.GetImageFormatExtension(img);
filename = "paste." + ext;
filename = $"paste.{ext}";
}
else
img = null;
+6 -41
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
@@ -19,11 +17,11 @@ namespace Volian.Controls.Library
// First parse the string
if (_LinkInfoText.Contains(@"\v"))
throw new Exception("LinkText.ParseLink found RTF token");
//_LinkInfoText = _LinkInfoText.Replace(@"\v ", ""); // this is not needed because this is selected Text does not contain RTF tokens
// for tran : "2, #, #, # and 4#Link:TransitionRange:2 10 173 166"
Match m = Regex.Match(_LinkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)");
_MyValue = m.Groups[1].Value;
_MyLink = "#Link:" + m.Groups[2].Value + ":" + m.Groups[3].Value;
//for debugging
//string _MyValue = m.Groups[1].Value;
//string _MyLink = $"#Link:{m.Groups[2].Value}:{m.Groups[3].Value}";
switch (m.Groups[2].Value)
{
case "ReferencedObject":
@@ -56,12 +54,9 @@ namespace Volian.Controls.Library
}
}
}
private string _LinkInfoText;
public string LinkInfoText
{
get { return _LinkInfoText; }
}
private TransitionInfo _MyTransitionInfo = null;
private readonly string _LinkInfoText;
public string LinkInfoText => _LinkInfoText;
private TransitionInfo _MyTransitionInfo = null;
public TransitionInfo MyTransitionInfo
{
get { ParseLink(); return _MyTransitionInfo; }
@@ -74,42 +69,12 @@ namespace Volian.Controls.Library
{
get { ParseLink(); return _MyTransitionInfo.MyItemRangeID; }
}
private string _MyValue = null;
//public string MyValue
//{
// get { ParseLink(); return _MyValue; }
//}
private string _MyLink = null;
//public string MyLink
//{
// get { ParseLink(); return _MyLink; }
//}
private RoUsageInfo _MyRoUsageInfo;
public RoUsageInfo MyRoUsageInfo
{
get { ParseLink(); return _MyRoUsageInfo; }
}
//private string _Roid = null; // TODO: need to return Referenced Object rather than just roid
//public string Roid
//{
// get { ParseLink(); return _Roid; }
//}
//private string _RoUsageid = null; // TODO: need to return Referenced Object rather than just roid
//public string RoUsageid
//{
// get { ParseLink(); return _RoUsageid; }
//}
//private string _RoDbid = null; // TODO: need to return Referenced Object rather than just roid
//public string RoDbid
//{
// get { ParseLink(); return _RoDbid; }
//}
private ParsedLinkType _MyParsedLinkType = ParsedLinkType.NotParsed;
//public ParsedLinkType MyParsedLinkType
//{
// get { ParseLink(); return _MyParsedLinkType; }
//}
}
#region enums
public enum ParsedLinkType : int
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Volian.Controls.Library
+35 -52
View File
@@ -13,15 +13,11 @@ namespace Volian.Controls.Library
public event ItemInfoEvent AfterRemove;
internal void OnAfterRemove(object sender)
{
if (AfterRemove != null) AfterRemove(sender);
}
private int _MaxItems = 10;
public int MaxItems
{
get { return _MaxItems; }
set { _MaxItems = value; }
}
public new MostRecentItem Add(MostRecentItem myMRI)
AfterRemove?.Invoke(sender);
}
public int MaxItems { get; set; } = 10;
public new MostRecentItem Add(MostRecentItem myMRI)
{
Refresh();
MostRecentItem tmp = null;
@@ -53,20 +49,19 @@ namespace Volian.Controls.Library
// when a delete item occurs.
void MyItemInfo_BeforeDelete(object sender)
{
ItemInfo ii = sender as ItemInfo;
if (ii != null)
{
MostRecentItem tmp = null;
// Look for the ItemID
foreach (MostRecentItem mri in this)
if (mri.ItemID == ii.ItemID)
tmp = mri;
// If it exists - remove it
if (tmp != null)
Remove(tmp);
OnAfterRemove(null);
}
}
if (sender is ItemInfo ii)
{
MostRecentItem tmp = null;
// Look for the ItemID
foreach (MostRecentItem mri in this)
if (mri.ItemID == ii.ItemID)
tmp = mri;
// If it exists - remove it
if (tmp != null)
Remove(tmp);
OnAfterRemove(null);
}
}
public MostRecentItem Add(int itemID)
{
ItemInfo tmp = ItemInfo.Get(itemID);
@@ -101,9 +96,11 @@ namespace Volian.Controls.Library
public static MostRecentItemList GetMRILst(System.Collections.Specialized.StringCollection list, int maxItems)
{
MostRecentItemList mril = new MostRecentItemList();
mril.MaxItems = maxItems;
if (list != null)
MostRecentItemList mril = new MostRecentItemList
{
MaxItems = maxItems
};
if (list != null)
for (int i = list.Count - 1; i >= 0;i-- )// Add in reverse order so first is last and last is first
mril.Add(list[i]);
return mril;
@@ -127,28 +124,21 @@ namespace Volian.Controls.Library
get
{
if (_MyItemInfo == null)
_MyItemInfo = ItemInfo.Get(_ItemID);
_MyItemInfo = ItemInfo.Get(ItemID);
return _MyItemInfo;
}
set
{
_ItemID = value.ItemID;
ItemID = value.ItemID;
_MyItemInfo = value;
_MenuTitle = GetMenuTitle();
_ToolTip = GetToolTip(_MyItemInfo);
}
}
internal void Refresh()
{
MyItemInfo = MyItemInfo;
}
private int _ItemID;
public int ItemID
{
get { return _ItemID; }
set { _ItemID = value; }
}
private string _MenuTitle;
internal void Refresh() => MyItemInfo = MyItemInfo;
public int ItemID { get; set; }
private string _MenuTitle;
public string MenuTitle
{
get
@@ -159,11 +149,8 @@ namespace Volian.Controls.Library
}
set { _MenuTitle = value; }
}
private string GetMenuTitle()
{
return MyItemInfo.Path;
}
private string _ToolTip;
private string GetMenuTitle() => MyItemInfo.Path;
private string _ToolTip;
public string ToolTip
{
get
@@ -177,10 +164,9 @@ namespace Volian.Controls.Library
private static string GetToolTip(ItemInfo item)
{
// reset active parent if null
// if (MyItemInfo.MyProcedure.ActiveParent == null) MyItemInfo.MyProcedure.ActiveParent = null;
DocVersionInfo tmp = (DocVersionInfo)(item.MyProcedure.ActiveParent);
StringBuilder sb = new StringBuilder();
int indent = BuildPath(tmp.MyFolder, ref sb);
_ = BuildPath(tmp.MyFolder, ref sb); //indent
return sb.ToString();
}
private static int BuildPath(FolderInfo folderInfo, ref StringBuilder sb)
@@ -192,7 +178,7 @@ namespace Volian.Controls.Library
}
public override string ToString()
{
return string.Format("{0}~{1}~{2}", _ItemID, MenuTitle, ToolTip);
return string.Format("{0}~{1}~{2}", ItemID, MenuTitle, ToolTip);
}
private static ItemInfo GetCorrectItemInfoType(int itemId)
{
@@ -228,9 +214,6 @@ namespace Volian.Controls.Library
}
return _RetainBadMRIs == 2;
}
public MostRecentItem(ItemInfo myItem)
{
MyItemInfo = myItem;
}
}
public MostRecentItem(ItemInfo myItem) => MyItemInfo = myItem;
}
}
@@ -1,11 +1,3 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Volian.Controls.Library
{
public partial class PreviewMultiLineRO : DevComponents.DotNetBar.Office2007Form //Form
@@ -1,10 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Volian.Controls.Library
@@ -30,9 +25,6 @@ namespace Volian.Controls.Library
this.roImage.Image = thmb;
this.Text = title;
}
public bool ThumbnailCallback()
{
return false;
}
}
public bool ThumbnailCallback() => false;
}
}
+6 -100
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
@@ -450,11 +448,6 @@ namespace Volian.Controls.Library
}
#endregion
#region Structures
//struct CharRange
//{
// public int cpMin;
// public int cpMax;
//}
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Auto)]
public struct CharFormat2
{
@@ -874,25 +867,6 @@ namespace Volian.Controls.Library
pft.dySpaceBefore = spaceBefore * 1440 / dpi;
SetParaFormat(richTextBox, pft);
}
//developed for equation editor interface work, but ended up not needing it. Kept it in
// case it is needed in the future.
//public static void SetSpaceAfter(RichTextBox richTextBox, int spaceAfter)
//{
// ParaFormatTwo pft = GetParaFormat(richTextBox);
// pft.dwMask = 0;
// pft.dwMask |= ParaFormatMasks.PFM_SPACEAFTER;
// // get the monitor's resolution in DPI and use it to set the linespacing value for
// // the richtextbox. Note that without this, the Arial Unicode font made the appearance of
// // almost double linespacing. Using PFS_Exact makes it appear as regular single spacing.
// Graphics g = richTextBox.CreateGraphics();
// int dpi = Convert.ToInt32((g.DpiX + g.DpiY) / 2);
// g.Dispose();
// // dyLineSpacing is Spacing between lines. the PFS_EXACT sets line spacing as the spacing from one
// //line to the next, in twips - thus the 1440.
// pft.dySpaceAfter = spaceAfter * 1440 / dpi;
// SetParaFormat(richTextBox, pft);
//}
public static void SetLineSpacing(RichTextBox richTextBox, ParaSpacing type)
{
ParaFormatTwo pft = GetParaFormat(richTextBox);
@@ -955,22 +929,18 @@ namespace Volian.Controls.Library
}
SetCharFormat(richTextBox, RTBSelection.SCF_SELECTION, cft);
}
public static bool IsSuperScript(RichTextBox richTextBox)
{
return (richTextBox.SelectionCharOffset>0);
}
public static bool IsSubScript(RichTextBox richTextBox)
{
return (richTextBox.SelectionCharOffset < 0);
}
public static void ToggleSubscript(bool bSet, RichTextBox richTextBox, RTBSelection selection)
public static bool IsSuperScript(RichTextBox richTextBox) => (richTextBox.SelectionCharOffset > 0);
public static bool IsSubScript(RichTextBox richTextBox) => (richTextBox.SelectionCharOffset < 0);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping RTBSelection")]
public static void ToggleSubscript(bool bSet, RichTextBox richTextBox, RTBSelection selection)
{
if (bSet)
richTextBox.SelectionCharOffset = -2;
else
richTextBox.SelectionCharOffset = 0;
}
public static void ToggleSuperscript(bool bSet, RichTextBox richTextBox, RTBSelection selection)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping RTBSelection")]
public static void ToggleSuperscript(bool bSet, RichTextBox richTextBox, RTBSelection selection)
{
if (bSet)
richTextBox.SelectionCharOffset = 2;
@@ -1040,70 +1010,6 @@ namespace Volian.Controls.Library
}
SetCharFormat(richTextBox, selection, cft);
}
//public static bool IsLink(RichTextBox richTextBox)
//{
// CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION);
// return ((cft.dwEffects & CharFormatEffects.CFE_PROTECTED) == CharFormatEffects.CFE_PROTECTED);
//}
//public static void ToggleLink(bool bSet, RichTextBox richTextBox, RTBSelection selection)
//{
// CharFormatTwo cft = GetCharFormat(richTextBox, selection);
// if (bSet)
// {
// cft.dwEffects |= CharFormatEffects.CFE_LINK;
// cft.dwMask |= CharFormatMasks.CFM_LINK;
// }
// else
// {
// cft.dwEffects &= ~RTBAPI.CharFormatEffects.CFE_LINK;
// }
// SetCharFormat(richTextBox, selection, cft);
//}
//public static void UnProtect(RichTextBox richTextBox) //, string type, string text, string link)
//{
// //richTextBox.DetectUrls = false;
// CharFormatTwo cft = GetCharFormat(richTextBox, RTBAPI.RTBSelection.SCF_SELECTION); ;
// //int position = richTextBox.SelectionStart = richTextBox.TextLength;
// //richTextBox.SelectionLength = 0;
// //richTextBox.SelectedRtf = @"{\rtf1\ansi " + text + @"\v #" + link + @"\v0}";
// //richTextBox.SelectedRtf = "{" + string.Format(@"\rtf1\ansi\protect\v {0}\v0 {1}\v #{2}", type, text, link) + "}";
// //richTextBox.Select(position, type.Length + text.Length + link.Length + 1);
// cft.dwMask = RTBAPI.CharFormatMasks.CFM_PROTECTED;
// cft.dwEffects = 0;
// // The lines below can be used to allow link text to be edited
// //charFormat.dwMask = RTBAPI.CharFormatMasks.CFM_LINK;
// //charFormat.dwEffects = RTBAPI.CharFormatEffects.CFE_LINK;
// SetCharFormat(richTextBox, RTBSelection.SCF_SELECTION, cft);
// //rtbRTF.SetSelectionLink(true);
// //richTextBox.SelectionStart = richTextBox.TextLength;
// //richTextBox.SelectionLength = 0;
//}
//public static void Protect(RichTextBox richTextBox) //, string type, string text, string link)
//{
// CharFormatTwo cft = GetCharFormat(richTextBox, RTBAPI.RTBSelection.SCF_SELECTION); ;
// cft.dwMask = CharFormatMasks.CFM_PROTECTED;
// cft.dwEffects = CharFormatEffects.CFE_PROTECTED;
// SetCharFormat(richTextBox, RTBSelection.SCF_SELECTION, cft);
//}
//public static void SetLink(RichTextBox richTextBox, string type, string text, string link)
//{
// richTextBox.DetectUrls = false;
// CharFormatTwo cft = GetCharFormat(richTextBox, RTBAPI.RTBSelection.SCF_SELECTION); ;
// int position = richTextBox.SelectionStart = richTextBox.TextLength;
// richTextBox.SelectionLength = 0;
// //richTextBox.SelectedRtf = @"{\rtf1\ansi " + text + @"\v #" + link + @"\v0}";
// richTextBox.SelectedRtf = "{" + string.Format(@"\rtf1\ansi\protect\v {0}\v0 {1}\v #{2}", type, text, link) + "}";
// richTextBox.Select(position, type.Length + text.Length + link.Length + 1);
// cft.dwMask = RTBAPI.CharFormatMasks.CFM_LINK | RTBAPI.CharFormatMasks.CFM_PROTECTED;
// cft.dwEffects = RTBAPI.CharFormatEffects.CFE_LINK | RTBAPI.CharFormatEffects.CFE_PROTECTED;
// // The lines below can be used to allow link text to be edited
// //charFormat.dwMask = RTBAPI.CharFormatMasks.CFM_LINK;
// //charFormat.dwEffects = RTBAPI.CharFormatEffects.CFE_LINK;
// SetCharFormat(richTextBox, RTBSelection.SCF_SELECTION, cft);
// //rtbRTF.SetSelectionLink(true);
// richTextBox.SelectionStart = richTextBox.TextLength;
// richTextBox.SelectionLength = 0;
//}
#endregion
}
}
+43 -240
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
@@ -36,14 +32,11 @@ namespace Volian.Controls.Library
public Label MyLabel
{ get { return lblTab; } }
/// <summary>
/// Used to connect the RichTextBox with the menus and toolbars
/// </summary>
public override StepRTB MyStepRTB
{
get { return _MyStepRTB; }
}
public override int TableWidth { get { return (int)GetTableWidth(_MyStepRTB.Font, MyItemInfo.MyContent.Text, true); } }
/// <summary>
/// Used to connect the RichTextBox with the menus and toolbars
/// </summary>
public override StepRTB MyStepRTB => _MyStepRTB;
public override int TableWidth { get { return (int)GetTableWidth(_MyStepRTB.Font, MyItemInfo.MyContent.Text, true); } }
/// <summary>
/// The left edge of the Tab
@@ -80,8 +73,6 @@ namespace Volian.Controls.Library
get { return _MyStepRTB.Width; }
set
{
// This is wrong for single column (KBR) - RHM Debug:
//MyStepRTB.Width = value;
Width = value + lblTab.Left + lblTab.Width + (this.Width - MyStepRTB.Right);
}
}
@@ -167,7 +158,6 @@ namespace Volian.Controls.Library
{
ItemInfo.ResetTabString(MyID);
string tabString = MyItemInfo.IsSection ? MyItemInfo.DisplayNumber.PadRight(MyItemInfo.MyTab.CleanText.Length) : MyItemInfo.MyTab.CleanText;
//string tabString = /*MyItemInfo.IsSection ? MyItemInfo.DisplayNumber : */ MyItemInfo.MyTab.CleanText;
if (!MyItemInfo.IsProcedure) lblTab.Text = tabString; // B2021-068: don't reset if procedure (it is blank when initialized)
// calculate the width based upon characters per inch considering user's DPI
@@ -182,7 +172,6 @@ namespace Volian.Controls.Library
bool lastDigitSingle = Regex.IsMatch(tabString, "^.*[^0-9][0-9] *$");
lblTab.Width = ((lastDigitSingle && MyItemInfo.IsStep ? 1 : 0) + tabString.Length) * MyStepPanel.DPI / cpi;
Invalidate();
//if (MyItemInfo.MyTab.Offset == 0) // commented out for Farley bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset)
{
// In the following if statement, the last part, 'IsHigh & PageBreakOnStep' (PageBreakOnStep
// flags background steps and IsHigh is for the HLS - Cautions/Notes were ok), was added
@@ -199,19 +188,14 @@ namespace Volian.Controls.Library
}
}
#endregion
#region Properties
private static int _RTBMargin = 3;
/// <summary>
/// Margin between the EditItem and the StepRTB. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RTBMargin
{
get { return _RTBMargin; }
set { _RTBMargin = value; }
}
private int? _CheckOffMargin = null;
#endregion
#region Properties
/// <summary>
/// Margin between the EditItem and the StepRTB. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RTBMargin { get; set; } = 3;
private int? _CheckOffMargin = null;
/// <summary>
/// Margin between the EditItem and the StepRTB. Appears on the Right.
/// Will allow space to draw a CheckOff on the right side of the EditItem.
@@ -238,32 +222,17 @@ namespace Volian.Controls.Library
}
set { _CheckOffMargin = value; }
}
private EnhancedAddTypes _EnhAddType = EnhancedAddTypes.No;
public EnhancedAddTypes EnhAddType
{
get { return _EnhAddType; }
set { _EnhAddType = value; }
}
private ItemInfo _EnhAddFromItemInfo = null;
public ItemInfo EnhAddFromItemInfo
{
get { return _EnhAddFromItemInfo; }
set { _EnhAddFromItemInfo = value; }
}
private bool _DoingPasteReplace = false;
public bool DoingPasteReplace
{
get { return _DoingPasteReplace; }
set { _DoingPasteReplace = value; }
}
#endregion
#region Constructors
public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand)
public EnhancedAddTypes EnhAddType { get; set; } = EnhancedAddTypes.No;
public ItemInfo EnhAddFromItemInfo { get; set; } = null;
public bool DoingPasteReplace { get; set; } = false;
#endregion
#region Constructors
public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand)
{
// B2016-179 If the parent is a section and the child is not a step then set expand to true.
// B2016-211 Added subsection check - don't expand all of the sub sections when you open a section (Farley)
expand |= (!itemInfo.IsStepPart && itemInfo.ActiveParent.IsSection) && !itemInfo.IsSubsection;
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
@@ -273,7 +242,6 @@ namespace Volian.Controls.Library
// B2016-179 If the parent is a section and the child is not a step then set expand to true.
// B2016-211 Added subsection check - don't expand all of the sub sections when you open a section (Farley)
expand |= (!itemInfo.IsStepPart && itemInfo.ActiveParent is SectionInfo) && !itemInfo.IsSubsection;
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
@@ -283,124 +251,10 @@ namespace Volian.Controls.Library
// B2016-179 If the parent is a section and the child is not a step then set expand to true.
// B2016-211 Added subsection check - don't expand all of the sub sections when you open a section (Farley)
expand |= (!itemInfo.IsStepPart && itemInfo.ActiveParent is SectionInfo) && !itemInfo.IsSubsection;
//// TIMING: DisplayItem.TimeIt("CSLARTB Top");
InitializeComponent();// TODO: Performance 25%
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, addFirstChld);
MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged);
}
//private void SetupRTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem)
//{
// //if (itemInfo.ItemID == 225) _MyStepRTB.Resize += new EventHandler(_MyStepRTB_Resize);
// //_MyStepRTB.MyRTBItem = this;
// //// TIMING: DisplayItem.TimeIt("CSLARTB InitComp");
// BackColor = myStepPanel.PanelColor;
// //_MyStepRTB.BackColor = myStepPanel.InactiveColor;
// // TODO: Adjust top based upon format
// // TODO: Remove Label and just output ident on the paint event
// lblTab.Left = 20;
// SetupHeader(itemInfo);
// this.Paint += new PaintEventHandler(RTBItem_Paint);
// this.BackColorChanged += new EventHandler(RTBItem_BackColorChanged);
// if (itemInfo != null)
// {
// ContentType = (int)itemInfo.MyContent.Type;
// switch (ContentType / 10000)
// {
// case 0: // Procedure
// _MyStepRTB.Font = myStepPanel.ProcFont;// lblTab.Font = myStepPanel.ProcFont;
// lblTab.Font = itemInfo.MyTab.MyFont.WindowsFont;
// break;
// case 1: // Section
// _MyStepRTB.Font = myStepPanel.SectFont;// lblTab.Font = myStepPanel.SectFont;
// lblTab.Font = itemInfo.MyTab.MyFont.WindowsFont;
// break;
// case 2: // Steps
// _MyStepRTB.Font = myStepPanel.StepFont;//lblTab.Font = myStepPanel.StepFont;
// lblTab.Font = itemInfo.MyTab.MyFont.WindowsFont;
// MyStepData = itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[ContentType % 10000];
// break;
// }
// //this.Move += new EventHandler(DisplayItem_Move);
// }
// else
// {
// if (myStepPanel.MyFont != null) _MyStepRTB.Font = lblTab.Font = myStepPanel.MyFont;
// }
// if (expand) _MyvlnExpander.ShowExpanded();
// MyStepPanel = myStepPanel;
// if (itemInfo != null) myStepPanel._LookupEditItems.Add(itemInfo.ItemID, this);
// _MyChildRelation = myChildRelation;
// if (myParentEditItem != null) RNOLevel = myParentEditItem.RNOLevel;
// if (itemInfo != null)
// {
// //// TIMING: DisplayItem.TimeIt("CSLARTB before _Layout");
// MyStepSectionLayoutData = itemInfo.ActiveFormat.MyStepSectionLayoutData;
// //// TIMING: DisplayItem.TimeIt("CSLARTB _Layout");
// if (myParentEditItem != null)
// SeqLevel = myParentEditItem.SeqLevel + ((myChildRelation == ChildRelation.After || myChildRelation == ChildRelation.Before) && itemInfo.IsSequential ? 1 : 0);
// //// TIMING: DisplayItem.TimeIt("CSLARTB seqLevel");
// MyItemInfo = itemInfo;
// MyItemInfo.MyConfig.PropertyChanged += new PropertyChangedEventHandler(MyConfig_PropertyChanged);
// }
// //// TIMING: DisplayItem.TimeIt("CSLARTB MyItem");
// myStepPanel.Controls.Add(this);
// switch (myChildRelation)
// {
// case ChildRelation.After:
// AddItem(myParentEditItem, ref myParentEditItem._MyAfterEditItems, nextEditItem);
// break;
// case ChildRelation.Before:
// AddItem(myParentEditItem, ref myParentEditItem._MyBeforeEditItems, nextEditItem);
// break;
// case ChildRelation.RNO:
// RNOLevel = myParentEditItem.RNOLevel + 1;
// AddItem(myParentEditItem, ref myParentEditItem._MyRNOEditItems, nextEditItem);
// break;
// case ChildRelation.None:
// break;
// }
// if (itemInfo != null)
// {
// if (myChildRelation == ChildRelation.None)
// {
// if (ContentType == 0 && MyStepSectionLayoutData != null)
// {
// LastMethodsPush(string.Format("SetupRTBItem {0}", MyID));
// Width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT);
// }
// }
// }
// //// TIMING: DisplayItem.TimeIt("CSLARTB Parent");
// SetText();
// //// TIMING: DisplayItem.TimeIt("CSLARTB SetText");
// if (itemInfo != null)
// {
// Name = string.Format("Item-{0}", itemInfo.ItemID);
// SetExpandAndExpander(itemInfo);
// if (expand && (itemInfo.MyContent.ContentPartCount != 0)) // If it should expand and it can expand
// Expand(true);
// else
// if (myParentEditItem == null)// If it is the top node
// if (ContentType >= 20000) // and it is a step - fully expand
// Expand(true);
// else // otherwise only expand one level
// Expand(false);
// }
// //// TIMING: DisplayItem.TimeIt("CSLARTB before Controls Add");
// //myStepPanel.Controls.Add(this);
// int top = FindTop(0);
// if (Top < top)
// {
// LastMethodsPush("SetupRTBItem");
// MyStepPanel.ItemMoving++;
// Top = top;
// MyStepPanel.ItemMoving--;
// LastMethodsPop();
// }
// _Loading = false;
// //// TIMING: DisplayItem.TimeIt("CSLARTB Controls Add");
//}
private void SetupHeader()
{
SetupHeader(MyItemInfo);
@@ -412,16 +266,13 @@ namespace Volian.Controls.Library
{
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
ScrollToCenter();
//MyStepPanel.ScrollControlIntoView(this);
}
void MyStepRTB_TextChanged(object sender, EventArgs e)
{
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
ScrollToCenter();
//MyStepPanel.ScrollControlIntoView(this);
}
private Label lblHeader = null;
private Label lblFooter = null;
private void SetupHeaderFooter(ref Label lbl, string name, MetaTag mTag)
{
if (lbl == null) lbl = new Label();
@@ -479,11 +330,9 @@ namespace Volian.Controls.Library
if (ed.Type != 0)
{
ItemInfo ii = ItemInfo.Get(ed.ItemID);
//if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(ii))
if (ii != null)
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnRefreshEnhancedDocument(new ItemSelectedChangedEventArgs(ii));
if (dti != null)
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
dti?.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
}
}
}
@@ -511,7 +360,6 @@ namespace Volian.Controls.Library
{
Cursor tmp = Cursor.Current;
Cursor.Current = Cursors.WaitCursor;
int top = TopMostEditItem.Top;// This doesn't work - this is since the last time it was expanded.
int topOffset = TopMostEditItem.Top + MyStepPanel.VerticalScroll.Value;
Colapsing = true;
// Hide Children
@@ -519,7 +367,6 @@ namespace Volian.Controls.Library
// Adjust Positions
int topOffsetAfter = TopMostEditItem.Top + MyStepPanel.VerticalScroll.Value;
ExpandPrefix = topOffset - topOffsetAfter;
//ExpandSuffix = BottomMostEditItem.Bottom - Bottom;
if (topOffsetAfter != topOffset)
{
LastMethodsPush(string.Format("Colapse {0}", MyID));
@@ -569,7 +416,7 @@ namespace Volian.Controls.Library
/// <param name="args"></param>
private void _MyStepRTB_LinkGoTo(object sender, StepPanelLinkEventArgs args)
{
_MyLog.DebugFormat("_DisplayRTB_LinkGoTo " + args.LinkInfoText);
_MyLog.DebugFormat($"_DisplayRTB_LinkGoTo {args.LinkInfoText}");
MyStepPanel.OnLinkClicked(sender, args);
}
void _MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
@@ -603,10 +450,6 @@ namespace Volian.Controls.Library
{
MyStepPanel.CursorMovement(this, args.CursorLocation, args.Key);
}
//private void _MyStepRTB_ModeChange(object sender, StepRTBModeChangeEventArgs args)
//{
// MyStepPanel.OnModeChange(sender as StepRTB, args);
//}
void _MyStepRTB_SetMenu(object sender, StepRTBMenuEventArgs args)
{
if (args.MenuGroup == null)
@@ -663,7 +506,6 @@ namespace Volian.Controls.Library
foreach (string line in lines)
{
string lineAdj = Regex.Replace(line, @"\\u....\?", "X"); // Replace Special characters
//line2 = Regex.Replace(line2, @"\\.*? ", ""); // Remove RTF Commands - Really should not be any
lineAdj = StepRTB.RemoveLinkComments(lineAdj);
// MeasureString doesn't work properly if the line include graphics characters.
// So, Measure a string of the same length with 'M's.
@@ -795,12 +637,11 @@ namespace Volian.Controls.Library
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
if (success)
{
StepConfig sc = MyStepRTB.MyItemInfo.MyConfig as StepConfig;
// if the plant has the change id option, the change id was entered when the program started.
// this should be saved for every piece of edited data. Note that the set of config
// item Step_MultipleChangeID has the save built in to it.
if (sc == null) sc = new StepConfig();
if (MyStepRTB.MyItemInfo.IsStep &&
// if the plant has the change id option, the change id was entered when the program started.
// this should be saved for every piece of edited data. Note that the set of config
// item Step_MultipleChangeID has the save built in to it.
if (!(MyStepRTB.MyItemInfo.MyConfig is StepConfig sc)) sc = new StepConfig();
if (MyStepRTB.MyItemInfo.IsStep &&
MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
&& !this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
{
@@ -884,7 +725,6 @@ namespace Volian.Controls.Library
}
public override void IdentifyMe(bool highlight)
{
//this.BringToFront(); // B2017-187 when called all the time, slows down the display of step and confuses the scroll bar
if (highlight)
{
MyStepRTB.BringToFront(); // B2017-187 when called all the time, slows down the display of step and confuses the scroll bar
@@ -931,7 +771,6 @@ namespace Volian.Controls.Library
{
_MyLog.WarnFormat("Attempt to give Focus to Disposed Object {0}", MyID);
}
// if (CanExpand) AutoExpand(); // Expand the item if you can
ScrollToCenter();
}
/// <summary>
@@ -942,19 +781,10 @@ namespace Volian.Controls.Library
_MyStepRTB.Focus();
ScrollToCenter();
}
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
{
return MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
}
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse)
{
return MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
}
public override void PositionToEnd()
{
MyStepRTB.SelectionStart = MyStepRTB.Text.Length;
}
public override void PositionToStart()
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) => MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg);
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) => MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse);
public override void PositionToEnd() => MyStepRTB.SelectionStart = MyStepRTB.Text.Length;
public override void PositionToStart()
{
return;
}
@@ -973,41 +803,21 @@ namespace Volian.Controls.Library
return null;
}
}
public override bool SpellCheckNext()
{
return MyStepRTB.SpellCheckNext();
}
public override void SetActive()
{
MyStepRTB.BackColor = MyStepPanel.ActiveColor;
}
public override bool Empty
public override bool SpellCheckNext() => MyStepRTB.SpellCheckNext();
public override void SetActive() => MyStepRTB.BackColor = MyStepPanel.ActiveColor;
public override bool Empty
{
get
{
// Console.WriteLine("step rtb is dirty {0} and rtf is {1}", MyStepRTB.IsDirty, MyStepRTB.Rtf);
// string txt = MyStepRTB.Text;
// Console.WriteLine("step rtb is dirty {0} and rtf is {1}", MyStepRTB.IsDirty, MyStepRTB.Rtf);
// return txt == "";
//return MyStepRTB.IsEmpty;
return MyStepRTB.Text == "";
}
set { MyStepRTB.Text = value ? "" : " "; }
}
//public override bool IsEmpty() // this becomes 'Empty' property, i.e. get/set.
//{ // for the set, emtpy is following line (= not ==).
// // for not empty - it's code that is in 'MakeNotEmpty'
// return MyStepRTB.Text == "";
//}
//public override void MakeNotEmpty()
//{
// MyStepRTB.Text = " ";
//}
public override void RefreshDisplay(bool activeMode)
{
MyStepRTB.VwMode = MyStepPanel.VwMode;
MyStepRTB.RefreshDisplay(activeMode);
//MyStepRTB.ViewRTB = !activeMode;
}
public override void ToggleEditView(E_ViewMode vwMode)
{
@@ -1026,8 +836,7 @@ namespace Volian.Controls.Library
public override void SetupHeader(ItemInfo itemInfo)
{
lblTab.Top = 3 + ((itemInfo.HasHeader) ? 23 : 0);
_MyStepRTB.Top = lblTab.Top; // 3 + ((itemInfo.HasHeader) ? 23 : 0);
//lblTab.Move += new EventHandler(lblTab_Move);
_MyStepRTB.Top = lblTab.Top;
if (itemInfo.HasHeader)
SetupHeaderFooter(ref lblHeader, "Header", itemInfo.MyHeader);
else
@@ -1037,14 +846,11 @@ namespace Volian.Controls.Library
lblHeader = null;
}
}
public override void ShowExpanded()
{
_MyvlnExpander.ShowExpanded();
}
/// <summary>
/// Sets the Item and as a result the text for the RichTextBox
/// </summary>
public override void SetText()
public override void ShowExpanded() => _MyvlnExpander.ShowExpanded();
/// <summary>
/// Sets the Item and as a result the text for the RichTextBox
/// </summary>
public override void SetText()
{
LastMethodsPush("SetText");
if (MyItemInfo != null)
@@ -1078,10 +884,7 @@ namespace Volian.Controls.Library
break;
}
}
public override void SaveCurrentAndContents()
{
SaveContents();
}
#endregion
}
public override void SaveCurrentAndContents() => SaveContents();
#endregion
}
}
@@ -1,13 +1,7 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;
using VEPROMS.CSLA.Library;
using System.Text.RegularExpressions;
namespace Volian.Controls.Library
{
+1 -22
View File
@@ -1,19 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volian.Controls.Library
{
public static class RomanNumeral
{
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private enum RomanOffset : int
{
Hundreds = 2,
Tens = 4,
Units = 6
}
private static string _Romans = "MDCLXVI";
private static readonly string _Romans = "MDCLXVI";
private static string RomanPart(RomanOffset offset, int value)
{
int iFive = value / 5;
@@ -34,21 +29,5 @@ namespace Volian.Controls.Library
RomanPart(RomanOffset.Tens, tens) +
RomanPart(RomanOffset.Units, units);
}
// private static int[] _TestRomans = new int[] {
// 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,25,30,40,50,60,69,70,80,90,99,
// 100,200,400,500,600,666,700,800,900,1000,1444,1666,1945,1997,1999,2000,2007,3000
// };
// public static void ShowRomans()
// {
// for (int i = 0; i < _TestRomans.Length; i++)
// {
// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", _TestRomans[i], Convert(_TestRomans[i]));
// }
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", 4, Convert(4));
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", 5, Convert(5));
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", 6, Convert(6));
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", 8, Convert(8));
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", 9, Convert(9));
// }
}
}
+63 -126
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
@@ -12,22 +8,13 @@ namespace Volian.Controls.Library
{
public partial class RtfRawItem : EditItem
{
#region IEditItem
public override StepRTB MyStepRTB
{
get { return _MyStepRTB; }
}
public override int TableWidth
{
get
{
return (int)_MyStepRTB.Width + RtfRawMargin;
}
}
/// <summary>
/// The left edge of the Tab (no visible tab, but use this for EditItem interfacing
/// </summary>
public override int ItemLeft
#region IEditItem
public override StepRTB MyStepRTB => _MyStepRTB;
public override int TableWidth => (int)_MyStepRTB.Width + RtfRawMargin;
/// <summary>
/// The left edge of the Tab (no visible tab, but use this for EditItem interfacing
/// </summary>
public override int ItemLeft
{
get { return Left + lblTab.Left; }
set { Left = value - lblTab.Left; }
@@ -62,11 +49,11 @@ namespace Volian.Controls.Library
Width = value + lblTab.Left + lblTab.Width;
}
}
public override int BorderWidth { get { return (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width); } }
/// <summary>
/// Location of the RichTextBox
/// </summary>
public override Point ContentLocation
public override int BorderWidth => (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width);
/// <summary>
/// Location of the RichTextBox
/// </summary>
public override Point ContentLocation
{
get { return new Point(Location.X + _MyStepRTB.Left, Location.Y); }
set { Location = new Point(value.X - _MyStepRTB.Left, value.Y); }
@@ -99,21 +86,15 @@ namespace Volian.Controls.Library
_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
ToolTipOnOff(); // B2025-050 Show the tooltip based on User Options Settings
}
public override void ToolTipOnOff()
{
_MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
}
public override void RefreshContent()
public override void ToolTipOnOff() => _MyToolTip.Enabled = VlnSettings.StepTypeToolTip; // B2025-XXX Show the tooltip based on User Options Settings
public override void RefreshContent()
{
IdentifyMe(false);
MyStepRTB.Rtf = MyItemInfo.MyContent.Text;
RefreshDisplay(false);
}
public override void RefreshOrdinal()
{
TabFormat = null;
}
public override void HandleResize() {}
public override void RefreshOrdinal() => TabFormat = null;
public override void HandleResize() {}
public override void MatchExpanded() {}
public override void ItemSelect()
{
@@ -136,11 +117,8 @@ namespace Volian.Controls.Library
_MyStepRTB.Focus();
ScrollToCenter();
}
public override void SetActive()
{
this.BackColor = MyStepPanel.ActiveColor;
}
public override void SetText()
public override void SetActive() => this.BackColor = MyStepPanel.ActiveColor;
public override void SetText()
{
LastMethodsPush("SetText");
if (MyItemInfo != null)
@@ -150,15 +128,9 @@ namespace Volian.Controls.Library
}
LastMethodsPop();
}
public override void SetExpandAndExpander(ItemInfo itemInfo)
{
CanExpand = false;
}
public override void SaveCurrentAndContents()
{
SaveContents();
}
public override void RefreshDisplay(bool activeMode)
public override void SetExpandAndExpander(ItemInfo itemInfo) => CanExpand = false;
public override void SaveCurrentAndContents() => SaveContents();
public override void RefreshDisplay(bool activeMode)
{
MyStepRTB.VwMode = MyStepPanel.VwMode;
Size sz = GetRtfRawSize(MyStepRTB.Rtf);
@@ -177,13 +149,10 @@ namespace Volian.Controls.Library
Width = sz.Width;
Height = _MyStepRTB.Height + _MyStepRTB.Top + 7;
ItemWidth = Width;
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling(true);
MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling();
}
public override void ToggleEditView(E_ViewMode vwMode)
{
SaveContents();
}
public override string TabFormat
public override void ToggleEditView(E_ViewMode vwMode) => SaveContents();
public override string TabFormat
{
get { return null; }
set { ;}
@@ -204,15 +173,9 @@ namespace Volian.Controls.Library
public override Point TabLocation { get { return lblTab.Location; } }
public override Font ContentFont { get { return MyStepRTB.Font; } set { /*MyStepRTB.Font = value*/; } }
public override float ContentTop { get { return MyStepRTB.Top; } }
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg)
{
return DialogResult.OK;
}
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse)
{
return false;
}
public override void PositionToEnd()
public override DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) => DialogResult.OK;
public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) => false;
public override void PositionToEnd()
{
return;
}
@@ -220,15 +183,9 @@ namespace Volian.Controls.Library
{
return;
}
public override string SelectedTextForFind
{
get {return null;}
}
public override bool SpellCheckNext()
{
return false;
}
public override bool Empty
public override string SelectedTextForFind => null;
public override bool SpellCheckNext() => false;
public override bool Empty
{
get
{
@@ -236,30 +193,22 @@ namespace Volian.Controls.Library
}
set { _MyStepRTB.Text = value ? "" : " "; }
}
public override void RefreshTab()
{
TabFormat = null;
}
public override void SetupHeader(ItemInfo itemInfo)
public override void RefreshTab() => TabFormat = null;
public override void SetupHeader(ItemInfo itemInfo)
{
return;
}
public override void ShowExpanded() {}
#endregion
#region Properties
private static int _RtfRawMargin = 6; // make it a little bigger than rtbitems so it can be seen
/// <summary>
/// Margin between the EditItem and the RtfRawItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RtfRawMargin
{
get { return _RtfRawMargin; }
set { _RtfRawMargin = value; }
}
#endregion
#region Constructors
public RtfRawItem()
#endregion
#region Properties
/// <summary>
/// Margin between the EditItem and the RtfRawItem. Appears on the Right.
/// Will allow space to draw a Change Bar on the right side of the EditItem.
/// </summary>
public static int RtfRawMargin { get; set; } = 6;
#endregion
#region Constructors
public RtfRawItem()
{
InitializeComponent();
}
@@ -313,14 +262,10 @@ namespace Volian.Controls.Library
Click += new EventHandler(RtfRawItem_Click);
MyStepRTB.Click += new EventHandler(RtfRawItem_Click);
}
#endregion
#region EventHandlers
void RtfRawItem_Click(object sender, EventArgs e)
{
//if (MyStepPanel.DisplayItemChanging) return;
MyStepPanel.SelectedEditItem = this;
}
private void _MyStepRTB_HeightChanged(object sender, EventArgs args)
#endregion
#region EventHandlers
void RtfRawItem_Click(object sender, EventArgs e) => MyStepPanel.SelectedEditItem = this;
private void _MyStepRTB_HeightChanged(object sender, EventArgs args)
{
if (this.Height != _MyStepRTB.Height + _MyStepRTB.Top + 7) // add in 7 to make it look good // + 10)
{
@@ -349,13 +294,10 @@ namespace Volian.Controls.Library
if (MyStepPanel.DisplayItemChanging) return;
MyStepPanel.SelectedEditItem = this;
}
#endregion
#region Methods
public override void SetFocus()
{
MyStepRTB.Focus();
}
public override void SaveContents()
#endregion
#region Methods
public override void SetFocus() => MyStepRTB.Focus();
public override void SaveContents()
{
SaveText();
SaveConfig();
@@ -379,26 +321,27 @@ namespace Volian.Controls.Library
_origBitmap = GetBitmap(res);
MyStepRTB.ClearUndo();
}
catch (Exception ex)
catch (Exception)
{
//MessageBox.Show("The data could not be saved.", "Object Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
public System.Drawing.Bitmap GetBitmap(string rtf)
{
Bitmap bmap = null;
Bitmap bmap;
try
{
System.Drawing.Size sz = RtfRawItem.GetRtfRawSize(rtf);
Volian.Controls.Library.RTF myRtb = new RTF();
myRtb.Size = sz;
myRtb.Rtf = rtf;
bmap = new System.Drawing.Bitmap((int)sz.Width, (int)sz.Height);
Volian.Controls.Library.RTF myRtb = new RTF
{
Size = sz,
Rtf = rtf
};
bmap = new System.Drawing.Bitmap((int)sz.Width, (int)sz.Height);
System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(bmap);
myRtb.RenderClipped(gr, new System.Drawing.Rectangle(0, 0, (int)sz.Width, (int)sz.Height));
}
catch (Exception ex)
catch (Exception)
{
return null;
}
@@ -478,14 +421,8 @@ namespace Volian.Controls.Library
if (MyStepPanel != null && this == MyStepPanel.SelectedEditItem)
ScrollToCenter();
}
private void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args)
{
MyStepPanel.StepCursorKeys(this, args);
}
private void MyStepRTB_CursorMovement(object sender, StepRTBCursorMovementEventArgs args)
{
MyStepPanel.CursorMovement(this, args.CursorLocation, args.Key);
}
#endregion
}
private void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args) => MyStepPanel.StepCursorKeys(this, args);
private void MyStepRTB_CursorMovement(object sender, StepRTBCursorMovementEventArgs args) => MyStepPanel.CursorMovement(this, args.CursorLocation, args.Key);
#endregion
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-1
View File
@@ -15,7 +15,6 @@ namespace Volian.Controls.Library
protected override void Dispose(bool disposing)
{
if (_Disposed) return;
_CountDisposed++;
_Disposed = true;
if (disposing && (components != null))
{
+101 -170
View File
@@ -1,11 +1,5 @@
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Drawing;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using System.Windows.Forms;
using JR.Utils.GUI.Forms;
@@ -14,45 +8,28 @@ namespace Volian.Controls.Library
public partial class StepTabPanel : DevComponents.DotNetBar.PanelDockContainer
{
#region Private Fields
private DisplayTabControl _MyDisplayTabControl;
private StepTabRibbon _MyStepTabRibbon;
public StepTabRibbon MyStepTabRibbon
{
get { return _MyStepTabRibbon; }
set { _MyStepTabRibbon = value; }
}
private StepPanel _MyStepPanel;
private DisplayTabItem _MyDisplayTabItem;
#endregion
#region Properties
/// <summary>
/// Container
/// </summary>
public DisplayTabControl MyDisplayTabControl
{
get { return _MyDisplayTabControl; }
//set { _MyDisplayTabControl = value; }
}
/// <summary>
/// StepPanel contained in this control.
/// </summary>
public Volian.Controls.Library.StepPanel MyStepPanel
{
get { return _MyStepPanel; }
//set { _MyStepPanel = value; }
}
/// <summary>
/// related DisplayTabItem
/// </summary>
public DisplayTabItem MyDisplayTabItem
{
get { return _MyDisplayTabItem; }
set { _MyDisplayTabItem = value; }
}
/// <summary>
/// Currently Selected ItemInfo
/// </summary>
public ItemInfo SelectedItemInfo
private readonly DisplayTabControl _MyDisplayTabControl;
public StepTabRibbon MyStepTabRibbon { get; set; }
private StepPanel _MyStepPanel;
#endregion
#region Properties
/// <summary>
/// Container
/// </summary>
public DisplayTabControl MyDisplayTabControl => _MyDisplayTabControl;
/// <summary>
/// StepPanel contained in this control.
/// </summary>
public Volian.Controls.Library.StepPanel MyStepPanel => _MyStepPanel;
/// <summary>
/// related DisplayTabItem
/// </summary>
public DisplayTabItem MyDisplayTabItem { get; set; }
/// <summary>
/// Currently Selected ItemInfo
/// </summary>
public ItemInfo SelectedItemInfo
{
get { return _MyStepPanel.SelectedItemInfo; }
set
@@ -63,22 +40,18 @@ namespace Volian.Controls.Library
FlexibleMessageBox.Show("The selected item is not available in the editor. One possible cause is that the data is 'not editable', check the section properties 'Editable Data' checkbox.", "Inaccessible Data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (_MyStepPanel.SelectedEditItem != null)
_MyStepPanel.SelectedEditItem.ItemSelect();
_MyStepPanel.SelectedEditItem?.ItemSelect();
if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem));
}
}
/// <summary>
/// Currently Selected EditItem
/// </summary>
public EditItem SelectedEditItem
{
get { return _MyStepPanel.SelectedEditItem; }
}
/// <summary>
/// Procedure ItemInfo
/// </summary>
public ItemInfo MyProcedureItemInfo
/// <summary>
/// Currently Selected EditItem
/// </summary>
public EditItem SelectedEditItem => _MyStepPanel.SelectedEditItem;
/// <summary>
/// Procedure ItemInfo
/// </summary>
public ItemInfo MyProcedureItemInfo
{
get { return _MyStepPanel.MyProcedureItemInfo; }
set { _MyStepPanel.MyProcedureItemInfo = value; }
@@ -120,14 +93,16 @@ namespace Volian.Controls.Library
/// </summary>
private void SetupStepTabRibbon()
{
_MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode);
_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
_MyStepTabRibbon.Name = "displayTabRibbon1";
//_MyTabRibbon.MyDisplayRTB = null;
_MyStepTabRibbon.MyEditItem = null;
this.Controls.Add(_MyStepTabRibbon);
_MyStepTabRibbon.Expanded = _MyDisplayTabControl.RibbonExpanded;
MyStepTabRibbon = new StepTabRibbon(_MyDisplayTabControl.IsInEditorialMode)
{
Dock = System.Windows.Forms.DockStyle.Top,
Location = new System.Drawing.Point(0, 0),
Name = "displayTabRibbon1",
//_MyTabRibbon.MyDisplayRTB = null;
MyEditItem = null
};
this.Controls.Add(MyStepTabRibbon);
MyStepTabRibbon.Expanded = _MyDisplayTabControl.RibbonExpanded;
}
/// <summary>
/// Setup this within control
@@ -142,7 +117,6 @@ namespace Volian.Controls.Library
/// </summary>
private void SetupStepPanel()
{
//this.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
_MyStepPanel = new Volian.Controls.Library.StepPanel(this.components);
this.Controls.Add(_MyStepPanel);
//
@@ -159,101 +133,73 @@ namespace Volian.Controls.Library
_MyStepPanel.ItemClick +=new Volian.Controls.Library.StepPanelEvent(_MyStepPanel_ItemClick);
_MyStepPanel.AttachmentClicked += new Volian.Controls.Library.StepPanelAttachmentEvent(_MyStepPanel_AttachmentClicked);
_MyStepPanel.ItemSelectedChanged += new ItemSelectedChangedEvent(_MyStepPanel_ItemSelectedChanged);
//_MyStepPanel.ModeChange += new Volian.Controls.Library.StepPanelModeChangeEvent(_MyStepPanel_ModeChange);
_MyStepPanel.TabDisplay += new Volian.Controls.Library.StepPanelTabDisplayEvent(_MyStepPanel_TabDisplay);
_MyStepPanel.WordSectionClose += new StepPanelWordSectionCloseEvent(_MyStepPanel_WordSectionClose);
_MyStepPanel.WordSectionDeleted += new StepPanelWordSectionDeletedEvent(_MyStepPanel_WordSectionDeleted);
_MyStepPanel.ItemPasted += new StepPanelItemPastedEvent(_MyStepPanel_ItemPasted);
}
#endregion
#region Event Handlers
private bool _ShowingItem = false;
public bool ShowingItem
#endregion
#region Event Handlers
public bool ShowingItem { get; set; } = false;
/// <summary>
/// Occurs when the user clicks on a StepTabPanel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StepTabPanel_Enter(object sender, EventArgs e)
{
get { return _ShowingItem; }
set { _ShowingItem = value; }
}
/// <summary>
/// Occurs when the user clicks on a StepTabPanel
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StepTabPanel_Enter(object sender, EventArgs e)
{
if (_ShowingItem) return;
if (ShowingItem) return;
// B2019-029: added to save a dirty annotation when the btnsave was not clicked (user just moves to another steprtb but had added annotationi text):
if (MyDisplayTabControl.MyAnnotationDetails.AnnotationDirty) MyDisplayTabControl.MyAnnotationDetails.SaveAnnotation();
_ShowingItem = true;
//if (ItemSelected != null)
ShowingItem = true;
_MyStepPanel.ItemShow();
if (_MyStepPanel.MyStepTabPanel != null) // B2014-024 if MyStepTabPanel is null then we are in the process of closing the procedure in that step panel
_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
_ShowingItem = false;
// B2014-024 if MyStepTabPanel is null then we are in the process of closing the procedure in that step panel
_MyStepPanel.MyStepTabPanel?.MyStepTabRibbon.SetUpdRoValBtn(_MyStepPanel.MyStepTabPanel.MyStepTabRibbon.NewerRoFst());
ShowingItem = false;
_MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem;
}
/// <summary>
/// Occurs when the cursor moves onto or off of a link
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkActiveChanged(object sender, StepPanelLinkEventArgs args)
/// <summary>
/// Occurs when the cursor moves onto or off of a link
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkActiveChanged(sender, args);
/// <summary>
/// Occurs when the user chooses to add a transition
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkInsertTran(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkInsertTran(sender, args);
/// <summary>
/// Occurs when the user chooses to add an RO
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkInsertRO(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkInsertRO(sender, args);
/// <summary>
/// Occurs when the user chosses to modify a transition
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkModifyTran(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkModifyTran(sender, args);
/// <summary>
/// Occurs when the user chooses to Modify an RO
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkModifyRO(object sender, StepPanelLinkEventArgs args) => _MyDisplayTabControl.OnLinkModifyRO(sender, args);
/// <summary>
/// Occurs when the Selected Item changes
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
_MyDisplayTabControl.OnLinkActiveChanged(sender, args);
}
/// <summary>
/// Occurs when the user chooses to add a transition
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkInsertTran(object sender, StepPanelLinkEventArgs args)
{
_MyDisplayTabControl.OnLinkInsertTran(sender, args);
}
/// <summary>
/// Occurs when the user chooses to add an RO
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkInsertRO(object sender, StepPanelLinkEventArgs args)
{
_MyDisplayTabControl.OnLinkInsertRO(sender, args);
}
/// <summary>
/// Occurs when the user chosses to modify a transition
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkModifyTran(object sender, StepPanelLinkEventArgs args)
{
_MyDisplayTabControl.OnLinkModifyTran(sender, args);
}
/// <summary>
/// Occurs when the user chooses to Modify an RO
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_LinkModifyRO(object sender, StepPanelLinkEventArgs args)
{
_MyDisplayTabControl.OnLinkModifyRO(sender, args);
}
/// <summary>
/// Occurs when the Selected Item changes
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
_MyStepTabRibbon.MyEditItem = args.MyEditItem;
MyStepTabRibbon.MyEditItem = args.MyEditItem;
_MyDisplayTabControl.OnItemSelectedChanged(sender, args);
}
// Occurs when the Mode Changes
//void _MyStepPanel_ModeChange(object sender, StepRTBModeChangeEventArgs args)
//{
// _MyDisplayTabControl.OnModeChange(sender, args);
//}
/// <summary>
/// Occurs when the user clicks on the Attachment Expander
/// </summary>
@@ -302,27 +248,12 @@ namespace Volian.Controls.Library
else
Console.WriteLine("Bring Up roeditor"); //TODO: Need to bring up roeditor or infopanel
}
void _MyStepPanel_TabDisplay(object sender, StepPanelTabDisplayEventArgs args)
{
_MyDisplayTabControl.OnPanelTabDisplay(sender, args);
}
void _MyStepPanel_WordSectionClose(object sender, WordSectionEventArgs args)
{
_MyDisplayTabControl.OnWordSectionClose(sender, args);
}
void _MyStepPanel_WordSectionDeleted(object sender, WordSectionEventArgs args)
{
_MyDisplayTabControl.OnWordSectionDeleted(sender, args);
}
void _MyStepPanel_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args)
{
_MyDisplayTabControl.OnItemPaste(sender, args);
}
public override string ToString()
{
return string.Format("StepTabPanel Procedure Item {0} {1}",
MyDisplayTabItem.MyItemInfo.ItemID, MyDisplayTabItem.MyItemInfo.DisplayNumber);
}
#endregion
}
void _MyStepPanel_TabDisplay(object sender, StepPanelTabDisplayEventArgs args) => _MyDisplayTabControl.OnPanelTabDisplay(sender, args);
void _MyStepPanel_WordSectionClose(object sender, WordSectionEventArgs args) => _MyDisplayTabControl.OnWordSectionClose(sender, args);
void _MyStepPanel_WordSectionDeleted(object sender, WordSectionEventArgs args) => _MyDisplayTabControl.OnWordSectionDeleted(sender, args);
void _MyStepPanel_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args) => _MyDisplayTabControl.OnItemPaste(sender, args);
public override string ToString() => string.Format("StepTabPanel Procedure Item {0} {1}",
MyDisplayTabItem.MyItemInfo.ItemID, MyDisplayTabItem.MyItemInfo.DisplayNumber);
#endregion
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -24,6 +24,7 @@ namespace Volian.Controls.Library
};
private DataTable values;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping bindingSource flexible")]
private BindingSource bindingSource = null;
private int totalrows = 1;
private int totalcols = 1;
@@ -104,8 +105,10 @@ namespace Volian.Controls.Library
void FormLoad_setDefaults(object sender, EventArgs e)
{
BindingSource bindingSourceDropDown = new BindingSource();
bindingSourceDropDown.DataSource = Enum.GetNames(typeof(EPinputtype));
BindingSource bindingSourceDropDown = new BindingSource
{
DataSource = Enum.GetNames(typeof(EPinputtype))
};
//in order to achieve a dropdown of possible values need
//to remove the auto-inserted columns
@@ -114,8 +117,10 @@ namespace Volian.Controls.Library
for (int c = 0; c < totalcols; c++)
{
dataview.Columns.RemoveAt(c);
var cName = new DataGridViewComboBoxColumn();
cName.DataSource = bindingSourceDropDown;
var cName = new DataGridViewComboBoxColumn
{
DataSource = bindingSourceDropDown
};
cName.DefaultCellStyle.NullValue = "none";
dataview.Columns.Insert(c, cName);
}
@@ -200,8 +205,10 @@ namespace Volian.Controls.Library
int endNumCols = (int)NumCols.Value;
int curNumCols = totalcols;
BindingSource bindingSourceDropDown = new BindingSource();
bindingSourceDropDown.DataSource = Enum.GetNames(typeof(EPinputtype));
BindingSource bindingSourceDropDown = new BindingSource
{
DataSource = Enum.GetNames(typeof(EPinputtype))
};
//remove cols till equal
while (curNumCols > endNumCols)
@@ -215,8 +222,10 @@ namespace Volian.Controls.Library
{
values.Columns.Add(new DataColumn($"Column{curNumCols + 1}") { DefaultValue = "none"});
if (dataview.Columns.Count > curNumCols) dataview.Columns.RemoveAt(curNumCols);
var cName = new DataGridViewComboBoxColumn();
cName.DataSource = bindingSourceDropDown;
var cName = new DataGridViewComboBoxColumn
{
DataSource = bindingSourceDropDown
};
cName.DefaultCellStyle.NullValue = "none";
dataview.Columns.Add(cName);
@@ -1,9 +1,5 @@
using System;
using System.Drawing;
//using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
//using System.Data;
namespace Volian.Controls.Library
{
@@ -52,8 +48,6 @@ namespace Volian.Controls.Library
{
SizeF txtSize = e.Graphics.MeasureString(_Caption, this.Font);
//Use a gray rectangle to show that the underlying control is inactive
//using (Brush b2 = new SolidBrush(Color.FromArgb(_Alpha, this.BackColor)))
// e.Graphics.FillRectangle(b2, this.ClientRectangle);
using (Brush b = new SolidBrush(Color.FromArgb(_Alpha, this.ForeColor)))
e.Graphics.DrawString(_Caption, this.Font, b, this.Width - txtSize.Width, 2);
}
+18 -43
View File
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Drawing;
using Volian.Base.Library;
@@ -162,23 +158,14 @@ namespace Volian.Controls.Library
HorizontalLines.DeleteColumns(column, count);
VerticalLines.DeleteColumns(column, count);
}
#endregion
#region Serialize
public string ConvertToString()
{
return GenericSerializer<VlnBorders>.StringSerialize(this);
}
public override string ToString()
{
return "Volian Custom Borders";
}
public static VlnBorders Get(string xml)
{
return GenericSerializer<VlnBorders>.StringDeserialize(xml);
}
#endregion
#region Line Pattern Static Methods
public static int LineWidth(GridLinePattern linePattern)
#endregion
#region Serialize
public string ConvertToString() => GenericSerializer<VlnBorders>.StringSerialize(this);
public override string ToString() => "Volian Custom Borders";
public static VlnBorders Get(string xml) => GenericSerializer<VlnBorders>.StringDeserialize(xml);
#endregion
#region Line Pattern Static Methods
public static int LineWidth(GridLinePattern linePattern)
{
switch (linePattern)
{
@@ -320,13 +307,10 @@ namespace Volian.Controls.Library
}
set { Lines[r * Columns + c] = value; }
}
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row)
{
InsertRows(row, 1);
}
public void InsertRows(int row, int count)
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row) => InsertRows(row, 1);
public void InsertRows(int row, int count)
{
// Create a new Array of the correct size
GridLinePattern[] newLines = new GridLinePattern[(Rows + count) * Columns];
@@ -343,11 +327,8 @@ namespace Volian.Controls.Library
Lines = newLines;
Rows = newRows;
}
public void DeleteRow(int row)
{
DeleteRows(row, 1);
}
public void DeleteRows(int row, int count)
public void DeleteRow(int row) => DeleteRows(row, 1);
public void DeleteRows(int row, int count)
{
GridLinePattern[] newLines = new GridLinePattern[(Rows - count) * Columns];
int newRows = Rows - count;
@@ -362,11 +343,8 @@ namespace Volian.Controls.Library
Lines = newLines;
Rows = newRows;
}
public void InsertColumn(int column)
{
InsertColumns(column, 1);
}
public void InsertColumns(int column, int count)
public void InsertColumn(int column) => InsertColumns(column, 1);
public void InsertColumns(int column, int count)
{
// Create a new Array of the correct size
GridLinePattern[] newLines = new GridLinePattern[Rows * (Columns + count)];
@@ -382,11 +360,8 @@ namespace Volian.Controls.Library
Lines = newLines;
Columns = newColumns;
}
public void DeleteColumn(int column)
{
DeleteColumns(column, 1);
}
public void DeleteColumns(int column, int count)
public void DeleteColumn(int column) => DeleteColumns(column, 1);
public void DeleteColumns(int column, int count)
{
GridLinePattern[] newLines = new GridLinePattern[Rows * (Columns - count)];
int newColumns = Columns - count;
+2 -3
View File
@@ -49,12 +49,11 @@ namespace Volian.Controls.Library
protected override void Dispose(bool disposing)
{
if (_Disposed) return;
_CountDisposed++;
_Disposed = true;
_MyBorders = null;
_MyShading = null;
_SpellChecker = null;
_tableCellEditor = null;
SpellChecker = null;
TableCellEditor = null;
if (disposing && (components != null))
{
components.Dispose();
File diff suppressed because it is too large Load Diff
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Drawing;
using Volian.Base.Library;
@@ -89,69 +84,26 @@ namespace Volian.Controls.Library
string strARGB = string.Format("[A={0}, R={1}, G={2}, B={3}]", clr.A, clr.R, clr.G, clr.B);
return strARGB;
}
public void SetColor(int row, int col, Color CellColor)
{
// Set the table cell to the ARGB representation of the passed in color
string cellShadeColor = GetARGBstring(CellColor);
TableShadingInfo[row, col] = cellShadeColor;
return;
}
#endregion
#region Insert and Remove Rows and Columns
public void InsertRow(int row)
{
TableShadingInfo.InsertRow(row);
}
public void InsertRows(int row, int count)
{
TableShadingInfo.InsertRows(row, count);
}
public void DeleteRow(int row)
{
TableShadingInfo.DeleteRow(row);
}
public void DeleteRows(int row, int count)
{
TableShadingInfo.DeleteRows(row, count);
}
public void InsertColumn(int column)
{
TableShadingInfo.InsertColumn(column);
}
public void InsertColumns(int column, int count)
{
TableShadingInfo.InsertColumns(column, count);
}
public void DeleteColumn(int column)
{
TableShadingInfo.DeleteColumn(column);
}
public void DeleteColumns(int column, int count)
{
TableShadingInfo.DeleteColumns(column, count);
}
#endregion
#region Serialize
public string ConvertToString()
#endregion
#region Insert and Remove Rows and Columns
public void InsertRow(int row) => TableShadingInfo.InsertRow(row);
public void InsertRows(int row, int count) => TableShadingInfo.InsertRows(row, count);
public void DeleteRow(int row) => TableShadingInfo.DeleteRow(row);
public void DeleteRows(int row, int count) => TableShadingInfo.DeleteRows(row, count);
public void InsertColumn(int column) => TableShadingInfo.InsertColumn(column);
public void InsertColumns(int column, int count) => TableShadingInfo.InsertColumns(column, count);
public void DeleteColumns(int column, int count) => TableShadingInfo.DeleteColumns(column, count);
#endregion
#region Serialize
public string ConvertToString()
{
return GenericSerializer<VlnGridCellShading>.StringSerialize(this);
}
public override string ToString()
{
return "Volian Custom Cell Shading";
}
public static VlnGridCellShading Get(string xml)
{
return GenericSerializer<VlnGridCellShading>.StringDeserialize(xml);
}
#endregion
// Adjust the cell shading array if needed
public void CheckAndFixShadingArraySize(int grdRows, int grdCols, Color defaultCellShading)
{
if (TableShadingInfo.Columns != grdCols || TableShadingInfo.Rows != grdRows)
TableShadingInfo = new CellShadingArray(defaultCellShading, grdRows, grdCols, TableShadingInfo.CellShadingColor);
}
}
[Serializable]
public class CellShadingArray
@@ -200,22 +152,6 @@ namespace Volian.Controls.Library
for (int c = 0; c < Columns; c++)
CellShadingColor[r * Columns + c] = defaultShadingColorARGB;
}
// Used to automatically adjust the cell shading color array
public CellShadingArray(Color defaultShadingColor, int rows, int columns, string[] shadeAry)
{
Rows = rows;
Columns = columns;
CellShadingColor = new string[rows * columns];
for (int r = 0; r < Rows; r++)
for (int c = 0; c < Columns; c++)
{
int idx = r * Columns + c;
if (idx < shadeAry.Length)
CellShadingColor[idx] = shadeAry[idx];
else
CellShadingColor[idx] = defaultShadingColor.ToString();
}
}
#endregion
#region Array Access
public string this[int r, int c]
@@ -232,13 +168,10 @@ namespace Volian.Controls.Library
CellShadingColor[r * Columns + c] = value;
}
}
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row)
{
InsertRows(row, 1);
}
public void InsertRows(int row, int count)
#endregion
#region Insert and Delete Rows and Columns
public void InsertRow(int row) => InsertRows(row, 1);
public void InsertRows(int row, int count)
{
// Create a new Array of the correct size
string[] newLines = new string[(Rows + count) * Columns];
@@ -255,11 +188,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Rows = newRows;
}
public void DeleteRow(int row)
{
DeleteRows(row, 1);
}
public void DeleteRows(int row, int count)
public void DeleteRow(int row) => DeleteRows(row, 1);
public void DeleteRows(int row, int count)
{
string[] newLines = new string[(Rows - count) * Columns];
int newRows = Rows - count;
@@ -274,11 +204,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Rows = newRows;
}
public void InsertColumn(int column)
{
InsertColumns(column, 1);
}
public void InsertColumns(int column, int count)
public void InsertColumn(int column) => InsertColumns(column, 1);
public void InsertColumns(int column, int count)
{
// Create a new Array of the correct size
string[] newLines = new string[Rows * (Columns + count)];
@@ -294,11 +221,8 @@ namespace Volian.Controls.Library
CellShadingColor = newLines;
Columns = newColumns;
}
public void DeleteColumn(int column)
{
DeleteColumns(column, 1);
}
public void DeleteColumns(int column, int count)
public void DeleteColumn(int column) => DeleteColumns(column, 1);
public void DeleteColumns(int column, int count)
{
string[] newLines = new string[Rows * (Columns - count)];
int newColumns = Columns - count;
+2 -13
View File
@@ -1,24 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
using VEPROMS.CSLA.Library;
namespace Volian.Controls.Library
{
public class VlnSpellCheck
{
private EditItem _MyEditItem;
public EditItem MyEditItem
{
get { return _MyEditItem; }
set
{
_MyEditItem = value;
}
}
public EditItem MyEditItem { get; set; }
public VlnSpellCheck()
public VlnSpellCheck()
{
}
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using C1.Win.C1SpellChecker;
namespace Volian.Controls.Library
@@ -19,31 +14,26 @@ namespace Volian.Controls.Library
private int _ErrorCount;
private int _ErrorIndex = -1; // current error index
private bool _AutoSuggest = true;
private string _NoSuggestionsText = "(no suggestions)";
private readonly string _NoSuggestionsText = "(no suggestions)";
Dictionary<string, string> _changeAll = new Dictionary<string, string>();
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
Dictionary<string, string> _changeAll = new Dictionary<string, string>();
/// <summary>
/// Gets the <see cref="CharRange"/> object that represents the error currently
/// displayed in the dialog.
/// </summary>
public CharRange CurrentError
{
get { return _Errors[_ErrorIndex]; }
}
public bool DidCorrectSpelling = false; // B2015-024 have Spell Checker text changes be in editorial mode (not assign a change bar but keep existing change bar)
/// <summary>
/// Gets the <see cref="CharRange"/> object that represents the error currently
/// displayed in the dialog.
/// </summary>
public CharRange CurrentError => _Errors[_ErrorIndex];
public bool DidCorrectSpelling = false; // B2015-024 have Spell Checker text changes be in editorial mode (not assign a change bar but keep existing change bar)
public VlnSpellCheckDlg()
{
InitializeComponent();
}
/// <summary>
/// Initializes the dialog to use the given parameters.
/// </summary>
/// <param name="spell"><see cref="C1SpellChecker"/> to use for spelling.</param>
/// <param name="editor"><see cref="ISpellCheckableEditor"/> that contains the text to spell-check.</param>
/// <param name="errors"><see cref="CharRangeList"/> that contains the initial error list.</param>
public void Initialize(C1SpellChecker spell, ISpellCheckableEditor editor, CharRangeList errors)
public VlnSpellCheckDlg() => InitializeComponent();
/// <summary>
/// Initializes the dialog to use the given parameters.
/// </summary>
/// <param name="spell"><see cref="C1SpellChecker"/> to use for spelling.</param>
/// <param name="editor"><see cref="ISpellCheckableEditor"/> that contains the text to spell-check.</param>
/// <param name="errors"><see cref="CharRangeList"/> that contains the initial error list.</param>
public void Initialize(C1SpellChecker spell, ISpellCheckableEditor editor, CharRangeList errors)
{
_Spell = spell;
_Editor = editor;
@@ -55,18 +45,15 @@ namespace Volian.Controls.Library
_ErrorCount += _Errors.Count;
btnAddToDictionary.Visible = _Spell.UserDictionary.Enabled;
}
/// <summary>
/// Gets the total number of errors detected in the control.
/// </summary>
public int ErrorCount
{
get { return _ErrorCount; }
}
/// <summary>
/// Gets the total number of errors detected in the control.
/// </summary>
public int ErrorCount => _ErrorCount;
/// <summary>
/// Gets or sets the index of the current error into the <see cref="Errors"/> list.
/// </summary>
public int ErrorIndex
/// <summary>
/// Gets or sets the index of the current error into the <see cref="Errors"/> list.
/// </summary>
public int ErrorIndex
{
get { return _ErrorIndex; }
set
@@ -105,7 +92,7 @@ namespace Volian.Controls.Library
{
// fire load event
base.OnLoad(e);
//AddHandle();
//AddHandle(); //For Debugging
// show first error (after firing load event)
ErrorIndex = 0;
}
@@ -204,8 +191,6 @@ namespace Volian.Controls.Library
// show 'Add' button only if user dictionary is enabled
btnAddToDictionary.Visible = _Spell.UserDictionary.Enabled;
// all ready, fire ErrorDisplayed event
//OnErrorDisplayed(EventArgs.Empty);
}
private void SetupSuggestions(string badWord)
@@ -251,23 +236,17 @@ namespace Volian.Controls.Library
return false;
}
private void btnChange_Click(object sender, EventArgs e)
{
UpdateEditor(txbBadWord.Text);
}
private void btnChange_Click(object sender, EventArgs e) => UpdateEditor(txbBadWord.Text);
private void btnChangeAll_Click(object sender, EventArgs e)
private void btnChangeAll_Click(object sender, EventArgs e)
{
_changeAll[CurrentError.Text] = txbBadWord.Text;
UpdateEditor(txbBadWord.Text);
}
private void btnIgnore_Click(object sender, EventArgs e)
{
ErrorIndex++;
}
private void btnIgnore_Click(object sender, EventArgs e) => ErrorIndex++;
private void btnIgnoreAll_Click(object sender, EventArgs e)
private void btnIgnoreAll_Click(object sender, EventArgs e)
{
//Console.WriteLine("handle: {0}", this.Handle);
_Spell.IgnoreList.Add(CurrentError.Text);
@@ -299,9 +278,6 @@ namespace Volian.Controls.Library
}
}
private void btnRemove_Click(object sender, EventArgs e)
{
UpdateEditor("");
}
}
private void btnRemove_Click(object sender, EventArgs e) => UpdateEditor("");
}
}
@@ -126,7 +126,6 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="AlphabeticalNumbering.cs" />
<Compile Include="AnnotationDetails.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -238,6 +237,9 @@
<Compile Include="FindReplace.designer.cs">
<DependentUpon>FindReplace.cs</DependentUpon>
</Compile>
<Compile Include="FlagEnumEditor.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="FormatUtility.cs" />
<Compile Include="frmEnhanced.cs">
<SubType>Form</SubType>
@@ -269,6 +271,7 @@
<Compile Include="frmViewTextFile.designer.cs">
<DependentUpon>frmViewTextFile.cs</DependentUpon>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="GridItem.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -368,9 +371,6 @@
<Compile Include="DSOTabPanel.designer.cs">
<DependentUpon>DSOTabPanel.cs</DependentUpon>
</Compile>
<Compile Include="FlagEnumEditor.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MostRecentItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
@@ -443,12 +443,6 @@
<Compile Include="vlnTreeView3.Designer.cs">
<DependentUpon>vlnTreeView3.cs</DependentUpon>
</Compile>
<Compile Include="WebBrowser.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WebBrowser.designer.cs">
<DependentUpon>WebBrowser.cs</DependentUpon>
</Compile>
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
@@ -557,10 +551,6 @@
<DependentUpon>VlnSpellCheckDlg.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="WebBrowser.resx">
<DependentUpon>WebBrowser.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DropDownPanel\DropDownPanel.csproj">
-63
View File
@@ -1,63 +0,0 @@
namespace Volian.Controls.Library
{
partial class WebBrowser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.WebBrowserWindow = new System.Windows.Forms.WebBrowser();
this.SuspendLayout();
//
// WebBrowserWindow
//
this.WebBrowserWindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.WebBrowserWindow.Location = new System.Drawing.Point(0, 0);
this.WebBrowserWindow.MinimumSize = new System.Drawing.Size(20, 20);
this.WebBrowserWindow.Name = "WebBrowserWindow";
this.WebBrowserWindow.Size = new System.Drawing.Size(1039, 723);
this.WebBrowserWindow.TabIndex = 0;
//this.WebBrowserWindow.Url = new System.Uri("http://www.volian.com", System.UriKind.Absolute);
//this.WebBrowserWindow.Url = new System.Uri(_currentURL, System.UriKind.Absolute);
//this.WebBrowserWindow.Navigate(_currentURL);
//
// WebBrowser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1039, 723);
this.Controls.Add(this.WebBrowserWindow);
this.Name = "WebBrowser";
this.ShowIcon = false;
this.Text = "WebBrowser";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.WebBrowser WebBrowserWindow;
}
}
@@ -1,38 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Volian.Controls.Library
{
public partial class WebBrowser : DevComponents.DotNetBar.Office2007Form //Form
{
private string _currentURL = @"http:/www.volian.com"; // default to volain web site
/// <summary>
/// Display an instance of the default internet web browser.
/// Note that besides a web site address, you can pass in a PDF file name (include the path).
/// This assumes that the user's web browser can display PDF files.
/// If nothing is passed in, then this will default to displaying the Volian Web Site.
/// </summary>
/// <param name="url">The URL of the web site you want to display</param>
public WebBrowser(string url)
{
_currentURL = url;
//this.Text = url;
InitializeComponent();
this.WebBrowserWindow.Navigate(_currentURL);
this.TitleText = _currentURL;
}
public WebBrowser()
{
InitializeComponent();
this.WebBrowserWindow.Navigate(_currentURL);
this.TitleText = _currentURL;
}
}
}
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+1 -6
View File
@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Volian.Controls.Library
{
public partial class dlgChgId : Form
{
DisplayTabControl TabControl;
readonly DisplayTabControl TabControl;
public dlgChgId(DisplayTabControl tc)
{
InitializeComponent();
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Volian.Controls.Library
@@ -12,11 +7,11 @@ namespace Volian.Controls.Library
// (a few users said that procedures 'disappeared' but this could not be reproduced)
public partial class dlgDelProcReason : Form
{
vlnTreeView VTreeView;
readonly vlnTreeView VTreeView;
public dlgDelProcReason(vlnTreeView tv)
{
InitializeComponent();
this.Text = "Verify Delete By " + Volian.Base.Library.VlnSettings.UserID;
this.Text = $"Verify Delete By {Volian.Base.Library.VlnSettings.UserID}";
VTreeView = tv;
tbDelProcReason.Focus();
}
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using JR.Utils.GUI.Forms;
@@ -13,10 +7,10 @@ namespace Volian.Controls.Library
{
public partial class dlgEnhMissingItem : Form
{
StepTabRibbon STRibbon = null;
private ItemInfo _SourceItem = null;
private int _EnhType = -1;
private bool _Initializing = false;
readonly StepTabRibbon STRibbon = null;
private readonly ItemInfo _SourceItem = null;
private readonly int _EnhType = -1;
private readonly bool _Initializing = false;
public bool OKSelected = false;
public dlgEnhMissingItem(StepTabRibbon strbn, ItemInfo srcItem, int enhType)
{
@@ -40,7 +34,7 @@ namespace Volian.Controls.Library
cbUnlinkedEnhancedItems.SelectedIndex = -1;
cbUnlinkedEnhancedItems.Enabled = false;
}
if (srcItem.IsProcedure) this.Text = "Create Missing Enhanced Item for " + srcItem.DisplayNumber;
if (srcItem.IsProcedure) this.Text = $"Create Missing Enhanced Item for {srcItem.DisplayNumber}";
else this.Text = "Create Missing Enhanced Item";
_Initializing = false;
}
@@ -90,9 +84,8 @@ namespace Volian.Controls.Library
// convert the data. If so, convert all items within it that can be linked. If not, just link as before.
if (_SourceItem.IsProcedure)
{
ItemInfo ii = cbUnlinkedEnhancedItems.SelectedItem as ItemInfo;
if (ii == null) return;
ContentInfoList cil = ContentInfoList.Get16BitEnhancedContents(_SourceItem.ItemID, ii.ItemID, _EnhType);
if (!(cbUnlinkedEnhancedItems.SelectedItem is ItemInfo ii)) return;
ContentInfoList cil = ContentInfoList.Get16BitEnhancedContents(_SourceItem.ItemID, ii.ItemID, _EnhType);
bool foundSubItem = false; // in returned list, see if there are any sections/steps. If none, don't prompt
foreach (ContentInfo ci in cil)
{
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Controls.Library;
using System.Linq;
namespace Volian.Controls.Library

Some files were not shown because too many files have changed in this diff Show More